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

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

Issue 331123003: Revert 277208 "[PPAPI] Compositor API implementation." (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 | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | ppapi/examples/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index f43107b0a25a36f78c05b551c5f857baf9075c3a..0811eba1f5d5c7cb0426baa15a1a18be97af67d4 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -35,7 +35,6 @@
#include "content/renderer/pepper/message_channel.h"
#include "content/renderer/pepper/npapi_glue.h"
#include "content/renderer/pepper/pepper_browser_connection.h"
-#include "content/renderer/pepper/pepper_compositor_host.h"
#include "content/renderer/pepper/pepper_file_ref_renderer_host.h"
#include "content/renderer/pepper/pepper_graphics_2d_host.h"
#include "content/renderer/pepper/pepper_in_process_router.h"
@@ -525,7 +524,6 @@ PepperPluginInstanceImpl::PepperPluginInstanceImpl(
full_frame_(false),
sent_initial_did_change_view_(false),
bound_graphics_2d_platform_(NULL),
- bound_compositor_(NULL),
has_webkit_focus_(false),
has_content_area_focus_(false),
find_identifier_(-1),
@@ -733,14 +731,11 @@ void PepperPluginInstanceImpl::InvalidateRect(const gfx::Rect& rect) {
else
container_->invalidateRect(rect);
}
-
- cc::Layer* layer =
- texture_layer_ ? texture_layer_.get() : compositor_layer_.get();
- if (layer) {
+ if (texture_layer_) {
if (rect.IsEmpty()) {
- layer->SetNeedsDisplay();
+ texture_layer_->SetNeedsDisplay();
} else {
- layer->SetNeedsDisplayRect(rect);
+ texture_layer_->SetNeedsDisplayRect(rect);
}
}
}
@@ -748,9 +743,7 @@ void PepperPluginInstanceImpl::InvalidateRect(const gfx::Rect& rect) {
void PepperPluginInstanceImpl::ScrollRect(int dx,
int dy,
const gfx::Rect& rect) {
- cc::Layer* layer =
- texture_layer_ ? texture_layer_.get() : compositor_layer_.get();
- if (layer) {
+ if (texture_layer_) {
InvalidateRect(rect);
} else if (fullscreen_container_) {
fullscreen_container_->ScrollRect(dx, dy, rect);
@@ -1284,8 +1277,6 @@ void PepperPluginInstanceImpl::ViewInitiatedPaint() {
bound_graphics_2d_platform_->ViewInitiatedPaint();
else if (bound_graphics_3d_.get())
bound_graphics_3d_->ViewInitiatedPaint();
- else if (bound_compositor_)
- bound_compositor_->ViewInitiatedPaint();
}
void PepperPluginInstanceImpl::ViewFlushedPaint() {
@@ -1295,8 +1286,6 @@ void PepperPluginInstanceImpl::ViewFlushedPaint() {
bound_graphics_2d_platform_->ViewFlushedPaint();
else if (bound_graphics_3d_.get())
bound_graphics_3d_->ViewFlushedPaint();
- else if (bound_compositor_)
- bound_compositor_->ViewFlushedPaint();
}
void PepperPluginInstanceImpl::SetSelectedText(
@@ -1997,28 +1986,24 @@ void PepperPluginInstanceImpl::UpdateLayer() {
}
bool want_3d_layer = !mailbox.IsZero();
bool want_2d_layer = !!bound_graphics_2d_platform_;
- bool want_texture_layer = want_3d_layer || want_2d_layer;
- bool want_compositor_layer = !!bound_compositor_;
+ bool want_layer = want_3d_layer || want_2d_layer;
- if ((want_texture_layer == !!texture_layer_.get()) &&
+ if ((want_layer == !!texture_layer_.get()) &&
(want_3d_layer == layer_is_hardware_) &&
- (want_compositor_layer == !!compositor_layer_) &&
layer_bound_to_fullscreen_ == !!fullscreen_container_) {
UpdateLayerTransform();
return;
}
- if (texture_layer_ || compositor_layer_) {
+ if (texture_layer_) {
if (!layer_bound_to_fullscreen_)
container_->setWebLayer(NULL);
else if (fullscreen_container_)
fullscreen_container_->SetLayer(NULL);
web_layer_.reset();
texture_layer_ = NULL;
- compositor_layer_ = NULL;
}
-
- if (want_texture_layer) {
+ if (want_layer) {
bool opaque = false;
if (want_3d_layer) {
DCHECK(bound_graphics_3d_.get());
@@ -2033,26 +2018,18 @@ void PepperPluginInstanceImpl::UpdateLayer() {
opaque = bound_graphics_2d_platform_->IsAlwaysOpaque();
texture_layer_->SetFlipped(false);
}
-
- // Ignore transparency in fullscreen, since that's what Flash always
- // wants to do, and that lets it not recreate a context if
- // wmode=transparent was specified.
- opaque = opaque || fullscreen_container_;
- texture_layer_->SetContentsOpaque(opaque);
web_layer_.reset(new webkit::WebLayerImpl(texture_layer_));
- } else if (want_compositor_layer) {
- compositor_layer_ = bound_compositor_->layer();
- web_layer_.reset(new webkit::WebLayerImpl(compositor_layer_));
- }
-
- if (web_layer_) {
if (fullscreen_container_) {
fullscreen_container_->SetLayer(web_layer_.get());
+ // Ignore transparency in fullscreen, since that's what Flash always
+ // wants to do, and that lets it not recreate a context if
+ // wmode=transparent was specified.
+ texture_layer_->SetContentsOpaque(true);
} else {
container_->setWebLayer(web_layer_.get());
+ texture_layer_->SetContentsOpaque(opaque);
}
}
-
layer_bound_to_fullscreen_ = !!fullscreen_container_;
layer_is_hardware_ = want_3d_layer;
UpdateLayerTransform();
@@ -2234,10 +2211,6 @@ PP_Bool PepperPluginInstanceImpl::BindGraphics(PP_Instance instance,
bound_graphics_2d_platform_->BindToInstance(NULL);
bound_graphics_2d_platform_ = NULL;
}
- if (bound_compositor_) {
- bound_compositor_->BindToInstance(NULL);
- bound_compositor_ = NULL;
- }
// Special-case clearing the current device.
if (!device) {
@@ -2256,16 +2229,10 @@ PP_Bool PepperPluginInstanceImpl::BindGraphics(PP_Instance instance,
RendererPpapiHost::GetForPPInstance(instance)->GetPpapiHost();
ppapi::host::ResourceHost* host = ppapi_host->GetResourceHost(device);
PepperGraphics2DHost* graphics_2d = NULL;
- PepperCompositorHost* compositor = NULL;
if (host) {
- if (host->IsGraphics2DHost()) {
+ if (host->IsGraphics2DHost())
graphics_2d = static_cast<PepperGraphics2DHost*>(host);
- } else if (host->IsCompositorHost()) {
- compositor = static_cast<PepperCompositorHost*>(host);
- } else {
- DLOG(ERROR) <<
- "Resource is not PepperCompositorHost or PepperGraphics2DHost.";
- }
+ DLOG_IF(ERROR, !graphics_2d) << "Resource is not PepperGraphics2DHost.";
}
EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false);
@@ -2274,13 +2241,7 @@ PP_Bool PepperPluginInstanceImpl::BindGraphics(PP_Instance instance,
? static_cast<PPB_Graphics3D_Impl*>(enter_3d.object())
: NULL;
- if (compositor) {
- if (compositor->BindToInstance(this)) {
- bound_compositor_ = compositor;
- UpdateLayer();
- return PP_TRUE;
- }
- } else if (graphics_2d) {
+ if (graphics_2d) {
if (graphics_2d->BindToInstance(this)) {
bound_graphics_2d_platform_ = graphics_2d;
UpdateLayer();
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | ppapi/examples/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698