Index: include/gpu/GrContext.h |
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h |
index 5c796b26c034833348014bf558b8d0700115aebf..7a18f7385e2402e9b9b001bc6f5c49ae8e7b31b3 100644 |
--- a/include/gpu/GrContext.h |
+++ b/include/gpu/GrContext.h |
@@ -57,12 +57,34 @@ public: |
virtual ~GrContext(); |
/** |
+ * We would move below enum to GrType.h if we are going to have multiple |
+ * sets of flags, such as D3D. |
+ */ |
+ enum GLBackendState { |
bsalomon
2013/06/26 19:03:07
Let's move it now so that we don't have to go back
|
+ kRenderTarget_GLBackendState = 0x01 << 0, |
+ kTextureBinding_GLBackendState = 0x01 << 1, |
+ // View state stands for scissor and viewport |
+ kView_GLBackendState = 0x01 << 2, |
+ kBlend_GLBackendState = 0x01 << 3, |
+ kAA_GLBackendState = 0x01 << 4, |
+ kVertex_GLBackendState = 0x01 << 5, |
+ kStencil_GLBackendState = 0x01 << 6, |
+ kPixelStore_GLBackendState = 0x01 << 7, |
+ kProgram_GLBackendState = 0x01 << 8, |
+ kPathStencil_GLBackendState = 0x01 << 9, |
+ kMisc_GLBackendState = 0x01 << 10, |
+ kALL_GLBackendState = 0xffff |
+ }; |
+ |
+ /** |
* The GrContext normally assumes that no outsider is setting state |
* within the underlying 3D API's context/device/whatever. This call informs |
* the context that the state was modified and it should resend. Shouldn't |
* be called frequently for good performance. |
+ * The flag bits, state, is dpendent on which backend is used by the |
+ * context, either GL or D3D (possible in future). |
*/ |
- void resetContext(); |
+ void resetContext(uint32_t state = kALL_GLBackendState); |
/** |
* Callback function to allow classes to cleanup on GrContext destruction. |