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/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.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 namespace internal { | 16 namespace internal { |
17 class ScopedAppGLStateRestoreImpl; | 17 class ScopedAppGLStateRestoreImpl; |
18 } | 18 } |
19 | 19 |
| 20 struct StencilState { |
| 21 unsigned char stencil_test_enabled; |
| 22 int stencil_front_func; |
| 23 int stencil_front_ref; |
| 24 int stencil_front_mask; |
| 25 int stencil_back_func; |
| 26 int stencil_back_ref; |
| 27 int stencil_back_mask; |
| 28 int stencil_clear; |
| 29 int stencil_front_writemask; |
| 30 int stencil_back_writemask; |
| 31 int stencil_front_fail_op; |
| 32 int stencil_front_z_fail_op; |
| 33 int stencil_front_z_pass_op; |
| 34 int stencil_back_fail_op; |
| 35 int stencil_back_z_fail_op; |
| 36 int stencil_back_z_pass_op; |
| 37 }; |
| 38 |
20 // This class is not thread safe and should only be used on the UI thread. | 39 // This class is not thread safe and should only be used on the UI thread. |
21 class ScopedAppGLStateRestore { | 40 class ScopedAppGLStateRestore { |
22 public: | 41 public: |
23 enum CallMode { | 42 enum CallMode { |
24 MODE_DRAW, | 43 MODE_DRAW, |
25 MODE_RESOURCE_MANAGEMENT, | 44 MODE_RESOURCE_MANAGEMENT, |
26 }; | 45 }; |
27 | 46 |
28 explicit ScopedAppGLStateRestore(CallMode mode); | 47 explicit ScopedAppGLStateRestore(CallMode mode); |
29 ~ScopedAppGLStateRestore(); | 48 ~ScopedAppGLStateRestore(); |
30 | 49 |
31 bool stencil_enabled() const; | 50 StencilState stencil_state() const; |
32 int framebuffer_binding_ext() const; | 51 int framebuffer_binding_ext() const; |
33 | 52 |
34 private: | 53 private: |
35 scoped_ptr<internal::ScopedAppGLStateRestoreImpl> impl_; | 54 scoped_ptr<internal::ScopedAppGLStateRestoreImpl> impl_; |
36 | 55 |
37 DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore); | 56 DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore); |
38 }; | 57 }; |
39 | 58 |
40 } // namespace android_webview | 59 } // namespace android_webview |
OLD | NEW |