Jason Sams | d19f10d | 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 | 9bee51c | 2009-08-05 13:57:03 -0700 | [diff] [blame] | 26 | class ProgramFragmentStoreState; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 27 | |
| 28 | class ProgramFragmentStore : public Program |
| 29 | { |
| 30 | public: |
Jason Sams | a9e7a05 | 2009-09-25 14:51:22 -0700 | [diff] [blame] | 31 | ProgramFragmentStore(Context *, Element *in, Element *out); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 32 | virtual ~ProgramFragmentStore(); |
| 33 | |
Jason Sams | b13ada5 | 2009-08-25 11:34:49 -0700 | [diff] [blame] | 34 | virtual void setupGL(const Context *, ProgramFragmentStoreState *); |
Jason Sams | d19f10d | 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 | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 55 | bool mDepthTestEnable; |
| 56 | bool mDepthWriteEnable; |
| 57 | int32_t mDepthFunc; |
| 58 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 59 | bool mStencilTestEnable; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 60 | }; |
| 61 | |
Jason Sams | 9bee51c | 2009-08-05 13:57:03 -0700 | [diff] [blame] | 62 | class ProgramFragmentStoreState |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 63 | { |
| 64 | public: |
| 65 | ProgramFragmentStoreState(); |
| 66 | ~ProgramFragmentStoreState(); |
Jason Sams | 9c54bdb | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 67 | void init(Context *rsc, int32_t w, int32_t h); |
Jason Sams | 61f08d6 | 2009-09-25 16:37:33 -0700 | [diff] [blame] | 68 | void deinit(Context *rsc); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 69 | |
Jason Sams | 9c54bdb | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 70 | ObjectBaseRef<ProgramFragmentStore> mDefault; |
Jason Sams | 9bee51c | 2009-08-05 13:57:03 -0700 | [diff] [blame] | 71 | ObjectBaseRef<ProgramFragmentStore> mLast; |
| 72 | |
| 73 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 74 | ProgramFragmentStore *mPFS; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | |
| 78 | } |
| 79 | } |
| 80 | #endif |
| 81 | |
| 82 | |
| 83 | |