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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

Issue 3067026: Initial port of accelerated compositor to Mac OS X 10.6. Reused... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
Index: chrome/browser/renderer_host/render_widget_host_view_mac.mm
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_mac.mm (revision 54820)
+++ chrome/browser/renderer_host/render_widget_host_view_mac.mm (working copy)
@@ -613,11 +613,12 @@
}
gfx::PluginWindowHandle
-RenderWidgetHostViewMac::AllocateFakePluginWindowHandle(bool opaque) {
+RenderWidgetHostViewMac::AllocateFakePluginWindowHandle(bool opaque,
+ bool root) {
// Make sure we have a layer for the plugin to draw into.
[cocoa_view_ ensureAcceleratedPluginLayer];
- return plugin_container_manager_.AllocateFakePluginWindowHandle(opaque);
+ return plugin_container_manager_.AllocateFakePluginWindowHandle(opaque, root);
}
void RenderWidgetHostViewMac::DestroyFakePluginWindowHandle(
@@ -650,6 +651,12 @@
void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped(
gfx::PluginWindowHandle window) {
[cocoa_view_ drawAcceleratedPluginLayer];
+ if (GetRenderWidgetHost()->is_gpu_rendering_active()) {
+ // Additionally dirty the entire region of the view to make AppKit
+ // and Core Animation think that our CALayer needs to repaint
+ // itself.
+ [cocoa_view_ setNeedsDisplayInRect:[cocoa_view_ frame]];
+ }
}
void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstances(
@@ -664,7 +671,8 @@
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- plugin_container_manager_.Draw(context);
+ plugin_container_manager_.Draw(
+ context, GetRenderWidgetHost()->is_gpu_rendering_active());
}
void RenderWidgetHostViewMac::AcceleratedSurfaceContextChanged() {
@@ -1165,6 +1173,15 @@
return;
}
+ if (renderWidgetHostView_->render_widget_host_->is_gpu_rendering_active()) {
+ // In this mode the accelerated plugin layer is considered to be
+ // opaque. We do not want its contents to be blended with anything
+ // underneath it.
+ acceleratedPluginLayer_.get().opaque = YES;
+ [acceleratedPluginLayer_.get() setNeedsDisplay];
+ return;
+ }
+
DCHECK(
renderWidgetHostView_->render_widget_host_->process()->HasConnection());
DCHECK(!renderWidgetHostView_->about_to_validate_and_paint_);
@@ -1279,6 +1296,11 @@
renderWidgetHostView_->whiteout_start_time_ = base::TimeTicks::Now();
}
+ // If we get here then the accelerated plugin layer is not supposed
+ // to be considered opaque -- plugins overlay the browser's normal
+ // painting.
+ acceleratedPluginLayer_.get().opaque = NO;
+
// This helps keep accelerated plugins' output in better sync with the
// window as it resizes.
[acceleratedPluginLayer_.get() setNeedsDisplay];
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_mac.h ('k') | chrome/browser/renderer_host/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698