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

Unified Diff: ui/gl/scoped_binders.h

Issue 1419733005: gpu: Add YCbCr 420v extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually enable/disable capabilities. Typo. Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_tests.gyp ('k') | ui/gl/scoped_binders.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/scoped_binders.h
diff --git a/ui/gl/scoped_binders.h b/ui/gl/scoped_binders.h
index dab7b3155487d78547ba0447485b6a965cc62eae..102e47e0503e2cc5a0be8ea25f0a992b2abdc917 100644
--- a/ui/gl/scoped_binders.h
+++ b/ui/gl/scoped_binders.h
@@ -27,6 +27,17 @@ 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_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedActiveTexture);
+};
class GL_EXPORT ScopedTextureBinder {
public:
@@ -45,6 +56,103 @@ 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 ScopedVertexAttribArray {
+ public:
+ ScopedVertexAttribArray(unsigned int index,
+ int size,
+ unsigned int type,
+ char normalized,
+ int stride,
+ const void* pointer);
+ ~ScopedVertexAttribArray();
+
+ private:
+ // TODO(dcastagna): Use GLStateRestorer.
+ int buffer_;
+ int enabled_;
+ int index_;
+ int size_;
+ int type_;
+ int normalized_;
+ int stride_;
+ void* pointer_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedVertexAttribArray);
+};
+
+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);
+};
+
+class GL_EXPORT ScopedVertexAttribPointer {
+ public:
+ ScopedVertexAttribPointer(unsigned index,
+ int size,
+ unsigned type,
+ char normalized,
+ int stride,
+ const void* pointer);
+ ~ScopedVertexAttribPointer();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScopedVertexAttribPointer);
+};
+
+class GL_EXPORT ScopedColorMask {
+ public:
+ ScopedColorMask(char red, char green, char blue, char alpha);
+ ~ScopedColorMask();
+
+ private:
+ unsigned char colors_[4] = {};
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedColorMask);
+};
+
+class GL_EXPORT ScopedCapability {
+ public:
+ ScopedCapability(unsigned capability, unsigned char enabled);
+ ~ScopedCapability();
+
+ private:
+ unsigned capability_;
+ unsigned char enabled_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedCapability);
+};
+
} // namespace gfx
#endif // UI_GL_SCOPED_BINDERS_H_
« no previous file with comments | « ui/gl/gl_tests.gyp ('k') | ui/gl/scoped_binders.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698