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

Side by Side Diff: ui/compositor/compositor.cc

Issue 271533014: Make ui::Layer use the cc:LayerTreeHost scale factor directly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove texture scaling fix Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « ui/aura/window_unittest.cc ('k') | ui/compositor/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 DCHECK_GT(scale, 0); 267 DCHECK_GT(scale, 0);
268 if (!size_in_pixel.IsEmpty()) { 268 if (!size_in_pixel.IsEmpty()) {
269 size_ = size_in_pixel; 269 size_ = size_in_pixel;
270 host_->SetViewportSize(size_in_pixel); 270 host_->SetViewportSize(size_in_pixel);
271 root_web_layer_->SetBounds(size_in_pixel); 271 root_web_layer_->SetBounds(size_in_pixel);
272 272
273 next_draw_is_resize_ = true; 273 next_draw_is_resize_ = true;
274 } 274 }
275 if (device_scale_factor_ != scale) { 275 if (device_scale_factor_ != scale) {
276 device_scale_factor_ = scale; 276 device_scale_factor_ = scale;
277 host_->SetDeviceScaleFactor(scale);
277 if (root_layer_) 278 if (root_layer_)
278 root_layer_->OnDeviceScaleFactorChanged(scale); 279 root_layer_->OnDeviceScaleFactorChanged(scale);
279 } 280 }
280 } 281 }
281 282
282 void Compositor::SetBackgroundColor(SkColor color) { 283 void Compositor::SetBackgroundColor(SkColor color) {
283 host_->set_background_color(color); 284 host_->set_background_color(color);
284 ScheduleDraw(); 285 ScheduleDraw();
285 } 286 }
286 287
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 // CompositorObservers to be notified before starting another 413 // CompositorObservers to be notified before starting another
413 // draw cycle. 414 // draw cycle.
414 ScheduleDraw(); 415 ScheduleDraw();
415 } 416 }
416 FOR_EACH_OBSERVER(CompositorObserver, 417 FOR_EACH_OBSERVER(CompositorObserver,
417 observer_list_, 418 observer_list_,
418 OnCompositingEnded(this)); 419 OnCompositingEnded(this));
419 } 420 }
420 421
421 } // namespace ui 422 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/window_unittest.cc ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698