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

Unified Diff: ui/gl/dirty_texture_state.h

Issue 104833007: Restore only modified texture state during virtual context switches (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More cleanup Created 7 years 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 | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | ui/gl/dirty_texture_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/dirty_texture_state.h
diff --git a/ui/gl/dirty_texture_state.h b/ui/gl/dirty_texture_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..a839142d6d670ab4afcfdd562b77e9eb9ff7d8a8
--- /dev/null
+++ b/ui/gl/dirty_texture_state.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GL_DIRTY_TEXTURE_STATE_H_
+#define UI_GL_DIRTY_TEXTURE_STATE_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_export.h"
+
+namespace gfx {
+
+struct DirtyTextureBindings {
+ bool binding_2d;
+ bool binding_cube_map;
+ bool binding_external_oes;
+ bool binding_rectangle_arb;
+ DirtyTextureBindings() : binding_2d(false),
+ binding_cube_map(false),
+ binding_external_oes(false),
+ binding_rectangle_arb(false) {
+ }
+};
+
+class DirtyTextureState {
+ public:
+ DirtyTextureState();
+ ~DirtyTextureState();
+
+ void UpdateMaxTextureUnit(GLenum texture_unit);
+ void AddBinding(GLuint current_unit, GLenum target);
+ void Clear();
+ int GetMaxTextureUnitIndex() const { return max_texture_unit_ - GL_TEXTURE0; }
+ bool IsBinding2DDirtyForUnit(GLuint unit) const {
+ return bindings_[unit].binding_2d;
+ }
+ bool IsBindingCubeMapDirtyForUnit(GLuint unit) const {
+ return bindings_[unit].binding_cube_map;
+ }
+ bool IsBindingExternalOesDirtyForUnit(GLuint unit) const {
+ return bindings_[unit].binding_external_oes;
+ }
+ bool IsBindingRectangleArbDirtyForUnit(GLuint unit) const {
+ return bindings_[unit].binding_rectangle_arb;
+ }
+
+ private:
+ std::vector<DirtyTextureBindings> bindings_;
+ GLenum max_texture_unit_;
+
+ DISALLOW_COPY_AND_ASSIGN(DirtyTextureState);
+};
+
+} // namespace gfx
+
+#endif // UI_GL_DIRTY_TEXTURE_STATE_H_
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | ui/gl/dirty_texture_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698