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

Side by Side Diff: gpu/command_buffer/service/gl_state_restorer_impl.h

Issue 205843002: GPU: Only restore one texture unit in ScopedTextureBinder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mock. Created 6 years, 9 months 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
OLDNEW
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 struct ContextState; 18 struct ContextState;
19 } 19 }
20 20
21 // This class implements a GLStateRestorer that forwards to a GLES2Decoder. 21 // This class implements a GLStateRestorer that forwards to a GLES2Decoder.
22 class GPU_EXPORT GLStateRestorerImpl : public gfx::GLStateRestorer { 22 class GPU_EXPORT GLStateRestorerImpl : public gfx::GLStateRestorer {
23 public: 23 public:
24 explicit GLStateRestorerImpl(base::WeakPtr<gles2::GLES2Decoder> decoder); 24 explicit GLStateRestorerImpl(base::WeakPtr<gles2::GLES2Decoder> decoder);
25 virtual ~GLStateRestorerImpl(); 25 virtual ~GLStateRestorerImpl();
26 26
27 virtual bool IsInitialized() OVERRIDE; 27 virtual bool IsInitialized() OVERRIDE;
28 virtual void RestoreState(const gfx::GLStateRestorer* prev_state) OVERRIDE; 28 virtual void RestoreState(const gfx::GLStateRestorer* prev_state) OVERRIDE;
29 virtual void RestoreAllTextureUnitBindings() OVERRIDE; 29 virtual void RestoreAllTextureUnitBindings() OVERRIDE;
30 virtual void RestoreActiveTextureUnitBinding(unsigned int target) OVERRIDE;
30 virtual void RestoreFramebufferBindings() OVERRIDE; 31 virtual void RestoreFramebufferBindings() OVERRIDE;
31 32
32 private: 33 private:
33 const gles2::ContextState* GetContextState() const; 34 const gles2::ContextState* GetContextState() const;
34 base::WeakPtr<gles2::GLES2Decoder> decoder_; 35 base::WeakPtr<gles2::GLES2Decoder> decoder_;
35 36
36 DISALLOW_COPY_AND_ASSIGN(GLStateRestorerImpl); 37 DISALLOW_COPY_AND_ASSIGN(GLStateRestorerImpl);
37 }; 38 };
38 39
39 } // namespace gpu 40 } // namespace gpu
40 41
41 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_STATE_RESTORER_IMPL_H_ 42 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_STATE_RESTORER_IMPL_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_state.cc ('k') | gpu/command_buffer/service/gl_state_restorer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698