| 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 <memory> | 5 #include <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 | 9 |
| 10 namespace gl { | 10 namespace gl { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // 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. |
| 40 class ScopedAppGLStateRestore { | 40 class ScopedAppGLStateRestore { |
| 41 public: | 41 public: |
| 42 enum CallMode { | 42 enum CallMode { |
| 43 MODE_DRAW, | 43 MODE_DRAW, |
| 44 MODE_RESOURCE_MANAGEMENT, | 44 MODE_RESOURCE_MANAGEMENT, |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 static ScopedAppGLStateRestore* Current(); |
| 48 |
| 47 explicit ScopedAppGLStateRestore(CallMode mode); | 49 explicit ScopedAppGLStateRestore(CallMode mode); |
| 48 ~ScopedAppGLStateRestore(); | 50 ~ScopedAppGLStateRestore(); |
| 49 | 51 |
| 50 StencilState stencil_state() const; | 52 StencilState stencil_state() const; |
| 51 int framebuffer_binding_ext() const; | 53 int framebuffer_binding_ext() const; |
| 52 | 54 |
| 53 private: | 55 private: |
| 54 std::unique_ptr<internal::ScopedAppGLStateRestoreImpl> impl_; | 56 std::unique_ptr<internal::ScopedAppGLStateRestoreImpl> impl_; |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore); | 58 DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace android_webview | 61 } // namespace android_webview |
| OLD | NEW |