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

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

Issue 8536049: Fix the race condition between mac drawRect and toggling accelerated compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 6fae1a31c5ada820818a167ba59b26a8a2c88725..c5b286aad1a40c71e1a466728ac4424186d468b7 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -226,6 +226,7 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget)
: render_widget_host_(widget),
about_to_validate_and_paint_(false),
call_set_needs_display_in_rect_pending_(false),
+ last_frame_was_accelerated_(false),
text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
is_loading_(false),
is_hidden_(false),
@@ -538,6 +539,8 @@ void RenderWidgetHostViewMac::ImeCompositionRangeChanged(
void RenderWidgetHostViewMac::DidUpdateBackingStore(
const gfx::Rect& scroll_rect, int scroll_dx, int scroll_dy,
const std::vector<gfx::Rect>& copy_rects) {
+ last_frame_was_accelerated_ = false;
+
if (!is_hidden_) {
std::vector<gfx::Rect> rects(copy_rects);
@@ -876,6 +879,7 @@ void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped(
AcceleratedPluginView* view = ViewForPluginWindowHandle(window);
DCHECK(view);
if (view) {
+ last_frame_was_accelerated_ = true;
plugin_container_manager_.SetSurfaceWasPaintedTo(window, surface_id);
// The surface is hidden until its first paint, to not show gargabe.
@@ -1738,8 +1742,7 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
const gfx::Rect damagedRect([self flipNSRectToRect:dirtyRect]);
- if (renderWidgetHostView_->render_widget_host_->
- is_accelerated_compositing_active()) {
+ if (renderWidgetHostView_->last_frame_was_accelerated_) {
gfx::Rect gpuRect;
gfx::PluginWindowHandle root_handle =
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698