blob: a3443873c91fc38af83c1c903f2c8241f2b80f7a [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 Samse514b452009-09-25 14:51:22 -070031 ProgramFragmentStore(Context *, Element *in, Element *out);
Jason Sams326e0dd2009-05-22 14:03:28 -070032 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 Samsf2649a92009-09-25 16:37:33 -070068 void deinit(Context *rsc);
Jason Sams326e0dd2009-05-22 14:03:28 -070069
Jason Sams8ce125b2009-06-17 16:52:59 -070070 ObjectBaseRef<ProgramFragmentStore> mDefault;
Jason Samscfb1d112009-08-05 13:57:03 -070071 ObjectBaseRef<ProgramFragmentStore> mLast;
72
73
Jason Sams326e0dd2009-05-22 14:03:28 -070074 ProgramFragmentStore *mPFS;
Jason Sams326e0dd2009-05-22 14:03:28 -070075};
76
77
78}
79}
80#endif
81
82
83