Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: include/gpu/GrContext.h

Issue 17027003: Add flag bits for partial GrContext reset (Closed)
Patch Set: change name style of enum, and remove resetTexture() Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | src/gpu/gl/GrGpuGL.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | src/gpu/gl/GrGpuGL.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698