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

Unified Diff: ppapi/proxy/compositor_layer_resource.cc

Issue 475123003: [PPAPI] Add target param for CompositorLayer::SetTexture(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review issues Created 6 years, 4 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 | « ppapi/proxy/compositor_layer_resource.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | 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 17bc7b2fe42287ee34a70608cad23be4e38d319d..09a63b18053558659ae5d7939958ae1e82cb7f7b 100644
--- a/ppapi/proxy/compositor_layer_resource.cc
+++ b/ppapi/proxy/compositor_layer_resource.cc
@@ -5,6 +5,7 @@
#include "ppapi/proxy/compositor_layer_resource.h"
#include "base/logging.h"
+#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "ppapi/proxy/compositor_resource.h"
@@ -121,8 +122,17 @@ int32_t CompositorLayerResource::SetColor(float red,
return PP_OK;
}
+int32_t CompositorLayerResource::SetTexture0_1(
+ PP_Resource context,
+ uint32_t texture,
+ const PP_Size* size,
+ const scoped_refptr<TrackedCallback>& release_callback) {
+ return SetTexture(context, GL_TEXTURE_2D, texture, size, release_callback);
+}
+
int32_t CompositorLayerResource::SetTexture(
PP_Resource context,
+ uint32_t target,
uint32_t texture,
const PP_Size* size,
const scoped_refptr<TrackedCallback>& release_callback) {
@@ -135,6 +145,12 @@ int32_t CompositorLayerResource::SetTexture(
if (enter.failed())
return PP_ERROR_BADRESOURCE;
+ if (target != GL_TEXTURE_2D &&
+ target != GL_TEXTURE_EXTERNAL_OES &&
+ target != GL_TEXTURE_RECTANGLE_ARB) {
+ return PP_ERROR_BADARGUMENT;
+ }
+
if (!size || size->width <= 0 || size->height <= 0)
return PP_ERROR_BADARGUMENT;
@@ -147,7 +163,7 @@ int32_t CompositorLayerResource::SetTexture(
gl->GenMailboxCHROMIUM(
reinterpret_cast<GLbyte*>(data_.texture->mailbox.name));
gl->ProduceTextureDirectCHROMIUM(
- texture, GL_TEXTURE_2D,
+ texture, target,
reinterpret_cast<const GLbyte*>(data_.texture->mailbox.name));
// Set the source size to (1, 1). It will be used to verify the source_rect
@@ -156,6 +172,7 @@ int32_t CompositorLayerResource::SetTexture(
data_.common.size = *size;
data_.common.resource_id = compositor_->GenerateResourceId();
+ data_.texture->target = target;
data_.texture->sync_point = gl->InsertSyncPointCHROMIUM();
data_.texture->source_rect.point = PP_MakeFloatPoint(0.0f, 0.0f);
data_.texture->source_rect.size = source_size_;
« no previous file with comments | « ppapi/proxy/compositor_layer_resource.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698