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

Unified Diff: ui/compositor/compositor.cc

Issue 13604007: Fix large mis-paint when resizing windows aura chrome (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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
« gpu/command_buffer/build_gles2_cmd_buffer.py ('K') | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
===================================================================
--- ui/compositor/compositor.cc (revision 192187)
+++ ui/compositor/compositor.cc (working copy)
@@ -12,6 +12,7 @@
#include "base/memory/singleton.h"
#include "base/message_loop.h"
#include "base/string_util.h"
+#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "cc/base/switches.h"
@@ -411,6 +412,7 @@
last_started_frame_(0),
last_ended_frame_(0),
disable_schedule_composite_(false),
+ is_resizing_ (false),
compositor_lock_(NULL) {
root_web_layer_ = cc::Layer::Create();
root_web_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f));
@@ -527,6 +529,18 @@
// compositeImmediately() directly.
Layout();
host_->Composite(base::TimeTicks::Now());
+
+#if defined(OS_WIN)
+ // While we resize, we are usually a few frames behind. By blocking
+ // the UI thread here we minize the area that is mis-painted, specially
+ // in the non-client area. See RenderWidgetHostViewAura::SetBounds for
+ // more details and bug 177115.
+ if (is_resizing_ && (last_ended_frame_ > 1)) {
+ is_resizing_ = false;
+ host_->FinishAllRendering();
+ }
+#endif
+
}
if (!pending_swap.posted())
NotifyEnd();
@@ -557,6 +571,8 @@
size_ = size_in_pixel;
host_->SetViewportSize(size_in_pixel, size_in_pixel);
root_web_layer_->SetBounds(size_in_pixel);
+
+ is_resizing_ = true;
}
if (device_scale_factor_ != scale) {
device_scale_factor_ = scale;
« gpu/command_buffer/build_gles2_cmd_buffer.py ('K') | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698