OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "ui/gl/gl_bindings.h" | 8 #include "ui/gl/gl_bindings.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
11 class GLContext; | 11 class GLContext; |
12 } | 12 } |
13 | 13 |
14 namespace android_webview { | 14 namespace android_webview { |
15 | 15 |
16 // This class is not thread safe and should only be used on the UI thread. | 16 // This class is not thread safe and should only be used on the UI thread. |
17 class ScopedAppGLStateRestore { | 17 class ScopedAppGLStateRestore { |
18 public: | 18 public: |
19 enum CallMode { | 19 enum CallMode { |
20 MODE_DRAW, | 20 MODE_DRAW, |
21 MODE_DETACH_FROM_WINDOW | 21 MODE_DETACH_FROM_WINDOW |
22 }; | 22 }; |
23 | 23 |
24 ScopedAppGLStateRestore(CallMode mode); | 24 ScopedAppGLStateRestore(CallMode mode); |
25 ~ScopedAppGLStateRestore(); | 25 ~ScopedAppGLStateRestore(); |
26 | 26 |
27 bool stencil_enabled() const { return stencil_test_; } | 27 bool stencil_enabled() const { return stencil_test_; } |
| 28 GLint framebuffer_binding_ext() const { return framebuffer_binding_ext_; } |
28 | 29 |
29 private: | 30 private: |
30 const CallMode mode_; | 31 const CallMode mode_; |
31 | 32 |
32 GLint pack_alignment_; | 33 GLint pack_alignment_; |
33 GLint unpack_alignment_; | 34 GLint unpack_alignment_; |
34 | 35 |
35 struct { | 36 struct { |
36 GLint enabled; | 37 GLint enabled; |
37 GLint size; | 38 GLint size; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 GLint active_texture_; | 77 GLint active_texture_; |
77 GLint viewport_[4]; | 78 GLint viewport_[4]; |
78 GLboolean scissor_test_; | 79 GLboolean scissor_test_; |
79 GLint scissor_box_[4]; | 80 GLint scissor_box_[4]; |
80 | 81 |
81 GLboolean stencil_test_; | 82 GLboolean stencil_test_; |
82 GLint stencil_func_; | 83 GLint stencil_func_; |
83 GLint stencil_mask_; | 84 GLint stencil_mask_; |
84 GLint stencil_ref_; | 85 GLint stencil_ref_; |
85 | 86 |
| 87 GLint framebuffer_binding_ext_; |
| 88 |
86 struct TextureBindings { | 89 struct TextureBindings { |
87 GLint texture_2d; | 90 GLint texture_2d; |
88 GLint texture_cube_map; | 91 GLint texture_cube_map; |
89 GLint texture_external_oes; | 92 GLint texture_external_oes; |
90 // TODO(boliu): TEXTURE_RECTANGLE_ARB | 93 // TODO(boliu): TEXTURE_RECTANGLE_ARB |
91 }; | 94 }; |
92 | 95 |
93 std::vector<TextureBindings> texture_bindings_; | 96 std::vector<TextureBindings> texture_bindings_; |
94 | 97 |
95 DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore); | 98 DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore); |
96 }; | 99 }; |
97 | 100 |
98 } // namespace android_webview | 101 } // namespace android_webview |
OLD | NEW |