OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains the GLStateRestorerImpl class. | 5 // This file contains the GLStateRestorerImpl class. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_STATE_RESTORER_IMPL_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_STATE_RESTORER_IMPL_H_ |
8 #define GPU_COMMAND_BUFFER_SERVICE_GL_STATE_RESTORER_IMPL_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_GL_STATE_RESTORER_IMPL_H_ |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "gpu/gpu_export.h" | 12 #include "gpu/gpu_export.h" |
13 #include "ui/gl/gl_state_restorer.h" | 13 #include "ui/gl/gl_state_restorer.h" |
14 | 14 |
15 namespace gpu { | 15 namespace gpu { |
16 namespace gles2 { | 16 namespace gles2 { |
17 class GLES2Decoder; | 17 class GLES2Decoder; |
18 } | 18 } |
19 | 19 |
20 // This class implements a GLStateRestorer that forwards to a GLES2Decoder. | 20 // This class implements a GLStateRestorer that forwards to a GLES2Decoder. |
21 class GPU_EXPORT GLStateRestorerImpl : public gfx::GLStateRestorer { | 21 class GPU_EXPORT GLStateRestorerImpl : public gfx::GLStateRestorer { |
22 public: | 22 public: |
23 explicit GLStateRestorerImpl(base::WeakPtr<gles2::GLES2Decoder> decoder); | 23 explicit GLStateRestorerImpl(base::WeakPtr<gles2::GLES2Decoder> decoder); |
24 virtual ~GLStateRestorerImpl(); | 24 virtual ~GLStateRestorerImpl(); |
25 | 25 |
| 26 virtual bool IsInitialized() OVERRIDE; |
26 virtual void RestoreState() OVERRIDE; | 27 virtual void RestoreState() OVERRIDE; |
27 virtual void RestoreAllTextureUnitBindings() OVERRIDE; | 28 virtual void RestoreAllTextureUnitBindings() OVERRIDE; |
28 virtual void RestoreFramebufferBindings() OVERRIDE; | 29 virtual void RestoreFramebufferBindings() OVERRIDE; |
29 | 30 |
30 private: | 31 private: |
31 base::WeakPtr<gles2::GLES2Decoder> decoder_; | 32 base::WeakPtr<gles2::GLES2Decoder> decoder_; |
32 | 33 |
33 DISALLOW_COPY_AND_ASSIGN(GLStateRestorerImpl); | 34 DISALLOW_COPY_AND_ASSIGN(GLStateRestorerImpl); |
34 }; | 35 }; |
35 | 36 |
36 } // namespace gpu | 37 } // namespace gpu |
37 | 38 |
38 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_STATE_RESTORER_IMPL_H_ | 39 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_STATE_RESTORER_IMPL_H_ |
OLD | NEW |