Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 383 // that this is at the expense of doing cause more frequent re-painting. A | 383 // that this is at the expense of doing cause more frequent re-painting. A |
| 384 // better scheme would be to maintain a tighter visible_content_rect for the | 384 // better scheme would be to maintain a tighter visible_content_rect for the |
| 385 // finer tilings. | 385 // finer tilings. |
| 386 CleanUpTilingsOnActiveLayer(last_append_quads_tilings_); | 386 CleanUpTilingsOnActiveLayer(last_append_quads_tilings_); |
| 387 } | 387 } |
| 388 | 388 |
| 389 bool PictureLayerImpl::UpdateTiles(bool resourceless_software_draw) { | 389 bool PictureLayerImpl::UpdateTiles(bool resourceless_software_draw) { |
| 390 DCHECK_EQ(1.f, contents_scale_x()); | 390 DCHECK_EQ(1.f, contents_scale_x()); |
| 391 DCHECK_EQ(1.f, contents_scale_y()); | 391 DCHECK_EQ(1.f, contents_scale_y()); |
| 392 | 392 |
| 393 // GPU rasterization can cause a tile size change when the viewport changes. | |
| 394 // Ensure that the tiling's texture sizes are correct after a viewport resize | |
| 395 // by tracking the last viewport rect and updating the current raster source, | |
| 396 // which will in turn update the tiling's texture size. | |
| 397 if (!last_viewport_size_.IsEmpty() && | |
|
danakj
2015/03/18 21:46:14
This looks like it should be below the !CanHaveTil
hendrikw
2015/03/18 22:06:31
Yeah, you're right.
| |
| 398 last_viewport_size_ != layer_tree_impl()->device_viewport_size() && | |
| 399 layer_tree_impl()->IsPendingTree()) { | |
| 400 tilings_->UpdateTilingsToCurrentRasterSource( | |
|
vmpstr
2015/03/18 21:36:39
In "typical" situations where the device viewport
danakj
2015/03/18 21:46:14
What if there's no pending tree (commit to active,
hendrikw
2015/03/18 22:06:31
Yeah, my first change (https://codereview.chromium
| |
| 401 raster_source_, nullptr, invalidation_, MinimumContentsScale(), | |
| 402 MaximumContentsScale()); | |
| 403 } | |
| 404 last_viewport_size_ = layer_tree_impl()->device_viewport_size(); | |
| 405 | |
| 393 if (!resourceless_software_draw) { | 406 if (!resourceless_software_draw) { |
| 394 visible_rect_for_tile_priority_ = visible_content_rect(); | 407 visible_rect_for_tile_priority_ = visible_content_rect(); |
| 395 } | 408 } |
| 396 | 409 |
| 397 if (!CanHaveTilings()) { | 410 if (!CanHaveTilings()) { |
| 398 ideal_page_scale_ = 0.f; | 411 ideal_page_scale_ = 0.f; |
| 399 ideal_device_scale_ = 0.f; | 412 ideal_device_scale_ = 0.f; |
| 400 ideal_contents_scale_ = 0.f; | 413 ideal_contents_scale_ = 0.f; |
| 401 ideal_source_scale_ = 0.f; | 414 ideal_source_scale_ = 0.f; |
| 402 SanityCheckTilingState(); | 415 SanityCheckTilingState(); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1228 | 1241 |
| 1229 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1242 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
| 1230 return !layer_tree_impl()->IsRecycleTree(); | 1243 return !layer_tree_impl()->IsRecycleTree(); |
| 1231 } | 1244 } |
| 1232 | 1245 |
| 1233 bool PictureLayerImpl::HasValidTilePriorities() const { | 1246 bool PictureLayerImpl::HasValidTilePriorities() const { |
| 1234 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1247 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
| 1235 } | 1248 } |
| 1236 | 1249 |
| 1237 } // namespace cc | 1250 } // namespace cc |
| OLD | NEW |