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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GL_DIRTY_TEXTURE_STATE_H_
6 #define UI_GL_DIRTY_TEXTURE_STATE_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "ui/gl/gl_bindings.h"
12 #include "ui/gl/gl_export.h"
13
14 namespace gfx {
15
16 struct DirtyTextureBindings {
17 bool binding_2d;
18 bool binding_cube_map;
19 bool binding_external_oes;
20 bool binding_rectangle_arb;
21 DirtyTextureBindings() : binding_2d(false),
22 binding_cube_map(false),
23 binding_external_oes(false),
24 binding_rectangle_arb(false) {
25 }
26 };
27
28 class DirtyTextureState {
29 public:
30 DirtyTextureState();
31 ~DirtyTextureState();
32
33 void UpdateMaxTextureUnit(GLenum texture_unit);
34 void AddBinding(GLuint current_unit, GLenum target);
35 void Clear();
36 int GetMaxTextureUnitIndex() const { return max_texture_unit_ - GL_TEXTURE0; }
37 bool IsBinding2DDirtyForUnit(GLuint unit) const {
38 return bindings_[unit].binding_2d;
39 }
40 bool IsBindingCubeMapDirtyForUnit(GLuint unit) const {
41 return bindings_[unit].binding_cube_map;
42 }
43 bool IsBindingExternalOesDirtyForUnit(GLuint unit) const {
44 return bindings_[unit].binding_external_oes;
45 }
46 bool IsBindingRectangleArbDirtyForUnit(GLuint unit) const {
47 return bindings_[unit].binding_rectangle_arb;
48 }
49
50 private:
51 std::vector<DirtyTextureBindings> bindings_;
52 GLenum max_texture_unit_;
53
54 DISALLOW_COPY_AND_ASSIGN(DirtyTextureState);
55 };
56
57 } // namespace gfx
58
59 #endif // UI_GL_DIRTY_TEXTURE_STATE_H_
OLDNEW
« 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