blob: d686aa85c8201295e2393a846232da415886a02b [file] [log] [blame]
Jason Samsd19f10d2009-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 Sams54db59c2010-05-13 18:30:11 -070026class ProgramStoreState;
Jason Samsd19f10d2009-05-22 14:03:28 -070027
Jason Sams54db59c2010-05-13 18:30:11 -070028class ProgramStore : public Program
Jason Samsd19f10d2009-05-22 14:03:28 -070029{
30public:
Jason Sams54db59c2010-05-13 18:30:11 -070031 ProgramStore(Context *);
32 virtual ~ProgramStore();
Jason Samsd19f10d2009-05-22 14:03:28 -070033
Jason Sams54db59c2010-05-13 18:30:11 -070034 virtual void setupGL(const Context *, ProgramStoreState *);
35 virtual void setupGL2(const Context *, ProgramStoreState *);
Jason Samsd19f10d2009-05-22 14:03:28 -070036
37 void setDepthFunc(RsDepthFunc);
38 void setDepthMask(bool);
39
40 void setBlendFunc(RsBlendSrcFunc src, RsBlendDstFunc dst);
41 void setColorMask(bool, bool, bool, bool);
42
43 void setDitherEnable(bool);
44
45protected:
46 bool mDitherEnable;
47
48 bool mBlendEnable;
49 bool mColorRWriteEnable;
50 bool mColorGWriteEnable;
51 bool mColorBWriteEnable;
52 bool mColorAWriteEnable;
53 int32_t mBlendSrc;
54 int32_t mBlendDst;
55
Jason Samsd19f10d2009-05-22 14:03:28 -070056 bool mDepthTestEnable;
57 bool mDepthWriteEnable;
58 int32_t mDepthFunc;
59
Jason Samsd19f10d2009-05-22 14:03:28 -070060 bool mStencilTestEnable;
Jason Samsd19f10d2009-05-22 14:03:28 -070061};
62
Jason Sams54db59c2010-05-13 18:30:11 -070063class ProgramStoreState
Jason Samsd19f10d2009-05-22 14:03:28 -070064{
65public:
Jason Sams54db59c2010-05-13 18:30:11 -070066 ProgramStoreState();
67 ~ProgramStoreState();
Jason Samsf603d212010-05-14 15:30:29 -070068 void init(Context *rsc);
Jason Sams61f08d62009-09-25 16:37:33 -070069 void deinit(Context *rsc);
Jason Samsd19f10d2009-05-22 14:03:28 -070070
Jason Sams54db59c2010-05-13 18:30:11 -070071 ObjectBaseRef<ProgramStore> mDefault;
72 ObjectBaseRef<ProgramStore> mLast;
Jason Sams9bee51c2009-08-05 13:57:03 -070073
74
Jason Sams54db59c2010-05-13 18:30:11 -070075 ProgramStore *mPFS;
Jason Samsd19f10d2009-05-22 14:03:28 -070076};
77
78
79}
80}
81#endif
82
83
84