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

Unified Diff: ppapi/proxy/compositor_layer_resource.cc

Issue 341893004: [PPAPI] Using ProduceTextureDirectCHROMIUM() to avoid binding and restoring GL_TEXTURE_2D target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/compositor_layer_resource.cc
diff --git a/ppapi/proxy/compositor_layer_resource.cc b/ppapi/proxy/compositor_layer_resource.cc
index fb1bbe5139aa863c14d697558e12f15a9beb6b28..a33f7c17f2ac7ff631f9ce49342e4fe555edc630 100644
--- a/ppapi/proxy/compositor_layer_resource.cc
+++ b/ppapi/proxy/compositor_layer_resource.cc
@@ -23,23 +23,6 @@ namespace proxy {
namespace {
-class Scoped2DTextureBinder {
- public:
- Scoped2DTextureBinder(GLES2Implementation* gl, uint32_t id)
- : gl_(gl), old_id_(-1) {
- gl_->GetIntegerv(GL_TEXTURE_BINDING_2D, &old_id_);
- gl_->BindTexture(GL_TEXTURE_2D, id);
- }
-
- ~Scoped2DTextureBinder() {
- gl_->BindTexture(GL_TEXTURE_2D, old_id_);
- }
-
- private:
- GLES2Implementation* gl_;
- int32_t old_id_;
-};
-
float clamp(float value) {
return std::min(std::max(value, 0.0f), 1.0f);
}
@@ -153,13 +136,12 @@ int32_t CompositorLayerResource::SetTexture(
static_cast<PPB_Graphics3D_Shared*>(enter.object());
GLES2Implementation* gl = graphics->gles2_impl();
- Scoped2DTextureBinder scoped_2d_texture_binder(gl, texture);
// Generate a Mailbox for the texture.
gl->GenMailboxCHROMIUM(
reinterpret_cast<GLbyte*>(data_.texture->mailbox.name));
- gl->ProduceTextureCHROMIUM(
- GL_TEXTURE_2D,
+ gl->ProduceTextureDirectCHROMIUM(
+ texture, GL_TEXTURE_2D,
reinterpret_cast<const GLbyte*>(data_.texture->mailbox.name));
// Set the source size to (1, 1). It will be used to verify the source_rect
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698