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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | src/gpu/gl/GrGpuGL.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef GrContext_DEFINED 10 #ifndef GrContext_DEFINED
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 static GrContext* Create(GrBackend, GrBackendContext); 50 static GrContext* Create(GrBackend, GrBackendContext);
51 51
52 /** 52 /**
53 * Returns the number of GrContext instances for the current thread. 53 * Returns the number of GrContext instances for the current thread.
54 */ 54 */
55 static int GetThreadInstanceCount(); 55 static int GetThreadInstanceCount();
56 56
57 virtual ~GrContext(); 57 virtual ~GrContext();
58 58
59 /** 59 /**
60 * We would move below enum to GrType.h if we are going to have multiple
61 * sets of flags, such as D3D.
62 */
63 enum GLBackendState {
bsalomon 2013/06/26 19:03:07 Let's move it now so that we don't have to go back
64 kRenderTarget_GLBackendState = 0x01 << 0,
65 kTextureBinding_GLBackendState = 0x01 << 1,
66 // View state stands for scissor and viewport
67 kView_GLBackendState = 0x01 << 2,
68 kBlend_GLBackendState = 0x01 << 3,
69 kAA_GLBackendState = 0x01 << 4,
70 kVertex_GLBackendState = 0x01 << 5,
71 kStencil_GLBackendState = 0x01 << 6,
72 kPixelStore_GLBackendState = 0x01 << 7,
73 kProgram_GLBackendState = 0x01 << 8,
74 kPathStencil_GLBackendState = 0x01 << 9,
75 kMisc_GLBackendState = 0x01 << 10,
76 kALL_GLBackendState = 0xffff
77 };
78
79 /**
60 * The GrContext normally assumes that no outsider is setting state 80 * The GrContext normally assumes that no outsider is setting state
61 * within the underlying 3D API's context/device/whatever. This call informs 81 * within the underlying 3D API's context/device/whatever. This call informs
62 * the context that the state was modified and it should resend. Shouldn't 82 * the context that the state was modified and it should resend. Shouldn't
63 * be called frequently for good performance. 83 * be called frequently for good performance.
84 * The flag bits, state, is dpendent on which backend is used by the
85 * context, either GL or D3D (possible in future).
64 */ 86 */
65 void resetContext(); 87 void resetContext(uint32_t state = kALL_GLBackendState);
66 88
67 /** 89 /**
68 * Callback function to allow classes to cleanup on GrContext destruction. 90 * Callback function to allow classes to cleanup on GrContext destruction.
69 * The 'info' field is filled in with the 'info' passed to addCleanUp. 91 * The 'info' field is filled in with the 'info' passed to addCleanUp.
70 */ 92 */
71 typedef void (*PFCleanUpFunc)(const GrContext* context, void* info); 93 typedef void (*PFCleanUpFunc)(const GrContext* context, void* info);
72 94
73 /** 95 /**
74 * Add a function to be called from within GrContext's destructor. 96 * Add a function to be called from within GrContext's destructor.
75 * This gives classes a chance to free resources held on a per context basis . 97 * This gives classes a chance to free resources held on a per context basis .
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 } 1042 }
1021 1043
1022 GrTexture* texture() { return fTexture; } 1044 GrTexture* texture() { return fTexture; }
1023 1045
1024 private: 1046 private:
1025 GrContext* fContext; 1047 GrContext* fContext;
1026 GrTexture* fTexture; 1048 GrTexture* fTexture;
1027 }; 1049 };
1028 1050
1029 #endif 1051 #endif
OLDNEW
« 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