OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |