Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 1 | /* |
| 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 | // --------------------------------------------------------------------------- |
| 23 | namespace android { |
| 24 | namespace renderscript { |
| 25 | |
Jason Sams | cfb1d11 | 2009-08-05 13:57:03 -0700 | [diff] [blame] | 26 | class ProgramFragmentStoreState; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 27 | |
| 28 | class ProgramFragmentStore : public Program |
| 29 | { |
| 30 | public: |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 31 | ProgramFragmentStore(Element *in, Element *out); |
| 32 | virtual ~ProgramFragmentStore(); |
| 33 | |
Jason Sams | afcb25c | 2009-08-25 11:34:49 -0700 | [diff] [blame] | 34 | virtual void setupGL(const Context *, ProgramFragmentStoreState *); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 35 | |
| 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 | |
| 44 | protected: |
| 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 Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 55 | bool mDepthTestEnable; |
| 56 | bool mDepthWriteEnable; |
| 57 | int32_t mDepthFunc; |
| 58 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 59 | bool mStencilTestEnable; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 60 | }; |
| 61 | |
Jason Sams | cfb1d11 | 2009-08-05 13:57:03 -0700 | [diff] [blame] | 62 | class ProgramFragmentStoreState |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 63 | { |
| 64 | public: |
| 65 | ProgramFragmentStoreState(); |
| 66 | ~ProgramFragmentStoreState(); |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 67 | void init(Context *rsc, int32_t w, int32_t h); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 68 | |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 69 | ObjectBaseRef<ProgramFragmentStore> mDefault; |
Jason Sams | cfb1d11 | 2009-08-05 13:57:03 -0700 | [diff] [blame] | 70 | ObjectBaseRef<ProgramFragmentStore> mLast; |
| 71 | |
| 72 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 73 | ProgramFragmentStore *mPFS; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | |
| 77 | } |
| 78 | } |
| 79 | #endif |
| 80 | |
| 81 | |
| 82 | |