Chromium Code Reviews| Index: ui/gl/scoped_binders.h |
| diff --git a/ui/gl/scoped_binders.h b/ui/gl/scoped_binders.h |
| index dab7b3155487d78547ba0447485b6a965cc62eae..42e5c2e58257ab6aed1017cbd2db51c71d6637d0 100644 |
| --- a/ui/gl/scoped_binders.h |
| +++ b/ui/gl/scoped_binders.h |
| @@ -27,6 +27,16 @@ class GL_EXPORT ScopedFrameBufferBinder { |
| DISALLOW_COPY_AND_ASSIGN(ScopedFrameBufferBinder); |
| }; |
| +class GL_EXPORT ScopedActiveTexture { |
| + public: |
| + ScopedActiveTexture(unsigned int texture); |
| + ~ScopedActiveTexture(); |
| + |
| + private: |
| + // TODO(dcastagna): Use GLStateRestorer. |
| + int old_texture_; |
|
reveman
2015/11/01 14:19:05
nit: blankline before DISALLOW_COP..
Daniele Castagna
2015/11/01 21:55:31
Done.
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedActiveTexture); |
| +}; |
| class GL_EXPORT ScopedTextureBinder { |
| public: |
| @@ -45,6 +55,54 @@ class GL_EXPORT ScopedTextureBinder { |
| DISALLOW_COPY_AND_ASSIGN(ScopedTextureBinder); |
| }; |
| +class GL_EXPORT ScopedUseProgram { |
| + public: |
| + ScopedUseProgram(unsigned int program); |
| + ~ScopedUseProgram(); |
| + |
| + private: |
| + // TODO(dcastagna): Use GLStateRestorer. |
| + int old_program_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ScopedUseProgram); |
| +}; |
| + |
| +class GL_EXPORT ScopedEnableVertexAttribArray { |
| + public: |
| + ScopedEnableVertexAttribArray(unsigned int index); |
| + ~ScopedEnableVertexAttribArray(); |
| + |
| + private: |
| + // TODO(dcastagna): Use GLStateRestorer. |
| + int enabled_; |
| + int index_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ScopedEnableVertexAttribArray); |
| +}; |
| + |
| +class GL_EXPORT ScopedBufferBinder { |
| + public: |
| + ScopedBufferBinder(unsigned int target, unsigned int index); |
| + ~ScopedBufferBinder(); |
| + |
| + private: |
| + // TODO(dcastagna): Use GLStateRestorer. |
| + int target_; |
| + int old_id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ScopedBufferBinder); |
| +}; |
| + |
| +class GL_EXPORT ScopedViewport { |
| + public: |
| + ScopedViewport(int x, int y, int width, int height); |
| + ~ScopedViewport(); |
| + |
| + private: |
| + int data_[4] = {}; |
| + DISALLOW_COPY_AND_ASSIGN(ScopedViewport); |
|
reveman
2015/11/01 14:19:05
nit: blankline before DISALLOW_COP..
Daniele Castagna
2015/11/01 21:55:31
Done.
|
| +}; |
| + |
| } // namespace gfx |
| #endif // UI_GL_SCOPED_BINDERS_H_ |