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

Unified Diff: content/renderer/pepper/pepper_platform_context_3d_impl.cc

Issue 9580030: Inform webkit when PPAPI plugin contents are opaque. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix is_opaque Created 8 years, 10 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 | « content/renderer/pepper/pepper_platform_context_3d_impl.h ('k') | webkit/plugins/ppapi/plugin_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_platform_context_3d_impl.cc
diff --git a/content/renderer/pepper/pepper_platform_context_3d_impl.cc b/content/renderer/pepper/pepper_platform_context_3d_impl.cc
index c16003c1add9695c92fd531fa2423c818ef7b168..812483dba063e3c92e3cb57951232152c26a14cd 100644
--- a/content/renderer/pepper/pepper_platform_context_3d_impl.cc
+++ b/content/renderer/pepper/pepper_platform_context_3d_impl.cc
@@ -21,6 +21,7 @@ PlatformContext3DImpl::PlatformContext3DImpl(
PepperParentContextProvider* parent_context_provider)
: parent_context_provider_(parent_context_provider),
parent_texture_id_(0),
+ has_alpha_(false),
command_buffer_(NULL),
weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
}
@@ -98,6 +99,9 @@ bool PlatformContext3DImpl::Init(const int32* attrib_list) {
case ContentGLContext::HEIGHT:
surface_size.set_height(attr[1]);
break;
+ case ContentGLContext::ALPHA_SIZE:
+ has_alpha_ = attr[1] > 0;
+ // fall-through
default:
attribs.push_back(attr[0]);
attribs.push_back(attr[1]);
@@ -152,6 +156,11 @@ unsigned PlatformContext3DImpl::GetBackingTextureId() {
return parent_texture_id_;
}
+bool PlatformContext3DImpl::IsOpaque() {
+ DCHECK(command_buffer_);
+ return !has_alpha_;
+}
+
gpu::CommandBuffer* PlatformContext3DImpl::GetCommandBuffer() {
return command_buffer_;
}
« no previous file with comments | « content/renderer/pepper/pepper_platform_context_3d_impl.h ('k') | webkit/plugins/ppapi/plugin_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698