blob: e646e03ef13679649ba0529dd0cff54f9e11bdc6 [file] [log] [blame]
Jason Sams326e0dd2009-05-22 14:03:28 -07001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_RS_PROGRAM_FRAGMENT_STORE_H
18#define ANDROID_RS_PROGRAM_FRAGMENT_STORE_H
19
20#include "rsProgram.h"
21
22// ---------------------------------------------------------------------------
23namespace android {
24namespace renderscript {
25
Jason Samscfb1d112009-08-05 13:57:03 -070026class ProgramFragmentStoreState;
Jason Sams326e0dd2009-05-22 14:03:28 -070027
28class ProgramFragmentStore : public Program
29{
30public:
Jason Sams326e0dd2009-05-22 14:03:28 -070031 ProgramFragmentStore(Element *in, Element *out);
32 virtual ~ProgramFragmentStore();
33
Jason Samsafcb25c2009-08-25 11:34:49 -070034 virtual void setupGL(const Context *, ProgramFragmentStoreState *);
Jason Sams326e0dd2009-05-22 14:03:28 -070035
36 void setDepthFunc(RsDepthFunc);
37 void setDepthMask(bool);
38
39 void setBlendFunc(RsBlendSrcFunc src, RsBlendDstFunc dst);
40 void setColorMask(bool, bool, bool, bool);
41
42 void setDitherEnable(bool);
43
44protected:
45 bool mDitherEnable;
46
47 bool mBlendEnable;
48 bool mColorRWriteEnable;
49 bool mColorGWriteEnable;
50 bool mColorBWriteEnable;
51 bool mColorAWriteEnable;
52 int32_t mBlendSrc;
53 int32_t mBlendDst;
54
Jason Sams326e0dd2009-05-22 14:03:28 -070055 bool mDepthTestEnable;
56 bool mDepthWriteEnable;
57 int32_t mDepthFunc;
58
Jason Sams326e0dd2009-05-22 14:03:28 -070059 bool mStencilTestEnable;
Jason Sams326e0dd2009-05-22 14:03:28 -070060};
61
Jason Samscfb1d112009-08-05 13:57:03 -070062class ProgramFragmentStoreState
Jason Sams326e0dd2009-05-22 14:03:28 -070063{
64public:
65 ProgramFragmentStoreState();
66 ~ProgramFragmentStoreState();
Jason Sams8ce125b2009-06-17 16:52:59 -070067 void init(Context *rsc, int32_t w, int32_t h);
Jason Sams326e0dd2009-05-22 14:03:28 -070068
Jason Sams8ce125b2009-06-17 16:52:59 -070069 ObjectBaseRef<ProgramFragmentStore> mDefault;
Jason Samscfb1d112009-08-05 13:57:03 -070070 ObjectBaseRef<ProgramFragmentStore> mLast;
71
72
Jason Sams326e0dd2009-05-22 14:03:28 -070073 ProgramFragmentStore *mPFS;
Jason Sams326e0dd2009-05-22 14:03:28 -070074};
75
76
77}
78}
79#endif
80
81
82