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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.h

Issue 118203002: During virtual context switches only restore texture units that have changed from the previous cont… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change mock GetContextState to return const ContextState* instead of non-const Created 6 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains the GLES2Decoder class. 5 // This file contains the GLES2Decoder class.
6 6
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_
8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 21 matching lines...) Expand all
32 struct Mailbox; 32 struct Mailbox;
33 33
34 namespace gles2 { 34 namespace gles2 {
35 35
36 class ContextGroup; 36 class ContextGroup;
37 class ErrorState; 37 class ErrorState;
38 class GLES2Util; 38 class GLES2Util;
39 class Logger; 39 class Logger;
40 class QueryManager; 40 class QueryManager;
41 class VertexArrayManager; 41 class VertexArrayManager;
42 struct ContextState;
42 43
43 struct DisallowedFeatures { 44 struct DisallowedFeatures {
44 DisallowedFeatures() 45 DisallowedFeatures()
45 : multisampling(false), 46 : multisampling(false),
46 gpu_memory_manager(false) { 47 gpu_memory_manager(false) {
47 } 48 }
48 49
49 bool multisampling; 50 bool multisampling;
50 bool gpu_memory_manager; 51 bool gpu_memory_manager;
51 }; 52 };
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 134
134 // Gets the associated GLContext. 135 // Gets the associated GLContext.
135 virtual gfx::GLContext* GetGLContext() = 0; 136 virtual gfx::GLContext* GetGLContext() = 0;
136 137
137 // Gets the associated ContextGroup 138 // Gets the associated ContextGroup
138 virtual ContextGroup* GetContextGroup() = 0; 139 virtual ContextGroup* GetContextGroup() = 0;
139 140
140 virtual Capabilities GetCapabilities() = 0; 141 virtual Capabilities GetCapabilities() = 0;
141 142
142 // Restores all of the decoder GL state. 143 // Restores all of the decoder GL state.
143 virtual void RestoreState() const = 0; 144 virtual void RestoreState(const ContextState* prev_state) const = 0;
144 145
145 // Restore States. 146 // Restore States.
146 virtual void RestoreActiveTexture() const = 0; 147 virtual void RestoreActiveTexture() const = 0;
147 virtual void RestoreAllTextureUnitBindings() const = 0; 148 virtual void RestoreAllTextureUnitBindings(
149 const ContextState* prev_state) const = 0;
148 virtual void RestoreAttribute(unsigned index) const = 0; 150 virtual void RestoreAttribute(unsigned index) const = 0;
149 virtual void RestoreBufferBindings() const = 0; 151 virtual void RestoreBufferBindings() const = 0;
150 virtual void RestoreFramebufferBindings() const = 0; 152 virtual void RestoreFramebufferBindings() const = 0;
151 virtual void RestoreGlobalState() const = 0; 153 virtual void RestoreGlobalState() const = 0;
152 virtual void RestoreProgramBindings() const = 0; 154 virtual void RestoreProgramBindings() const = 0;
153 virtual void RestoreRenderbufferBindings() const = 0; 155 virtual void RestoreRenderbufferBindings() const = 0;
154 virtual void RestoreTextureState(unsigned service_id) const = 0; 156 virtual void RestoreTextureState(unsigned service_id) const = 0;
155 virtual void RestoreTextureUnitBindings(unsigned unit) const = 0; 157 virtual void RestoreTextureUnitBindings(unsigned unit) const = 0;
156 158
157 // Gets the QueryManager for this context. 159 // Gets the QueryManager for this context.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 virtual bool WasContextLost() = 0; 223 virtual bool WasContextLost() = 0;
222 224
223 // Returns true if the context was lost specifically by GL_ARB_robustness. 225 // Returns true if the context was lost specifically by GL_ARB_robustness.
224 virtual bool WasContextLostByRobustnessExtension() = 0; 226 virtual bool WasContextLostByRobustnessExtension() = 0;
225 227
226 // Lose this context. 228 // Lose this context.
227 virtual void LoseContext(uint32 reset_status) = 0; 229 virtual void LoseContext(uint32 reset_status) = 0;
228 230
229 virtual Logger* GetLogger() = 0; 231 virtual Logger* GetLogger() = 0;
230 232
233 virtual const ContextState* GetContextState() = 0;
234
231 protected: 235 protected:
232 GLES2Decoder(); 236 GLES2Decoder();
233 237
234 private: 238 private:
235 bool initialized_; 239 bool initialized_;
236 bool debug_; 240 bool debug_;
237 bool log_commands_; 241 bool log_commands_;
238 242
239 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); 243 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder);
240 }; 244 };
241 245
242 } // namespace gles2 246 } // namespace gles2
243 } // namespace gpu 247 } // namespace gpu
248
244 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ 249 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gl_state_restorer_impl.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698