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

Unified Diff: ui/compositor/compositor.cc

Issue 1513053002: WIP - Gutterless resize on Windows Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index fbc801dbe7cd13b8708985c76eb565c09859e038..57b886e69a14cd3296349fe922061195ad3450c3 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -79,6 +79,7 @@ Compositor::Compositor(ui::ContextFactory* context_factory,
locks_will_time_out_(true),
compositor_lock_(NULL),
layer_animator_collection_(this),
+ has_swapped_frame_at_current_size_(false),
weak_ptr_factory_(this) {
root_web_layer_ = cc::Layer::Create(Layer::UILayerSettings());
@@ -277,6 +278,10 @@ void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) {
void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) {
DCHECK_GT(scale, 0);
if (!size_in_pixel.IsEmpty()) {
+ if (size_ != size_in_pixel) {
+ has_swapped_frame_at_current_size_ = false;
+ }
+
size_ = size_in_pixel;
host_->SetViewportSize(size_in_pixel);
root_web_layer_->SetBounds(size_in_pixel);
@@ -438,6 +443,7 @@ void Compositor::DidCommitAndDrawFrame() {
}
void Compositor::DidCompleteSwapBuffers() {
+ has_swapped_frame_at_current_size_ = true;
piman 2015/12/11 07:53:12 It is possible that the main thread will start the
ericrk 2015/12/15 00:25:03 Good feedback - I've updated this to use a SwapPro
FOR_EACH_OBSERVER(CompositorObserver, observer_list_,
OnCompositingEnded(this));
}

Powered by Google App Engine
This is Rietveld 408576698