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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 raster_source_->CreateCloneWithoutLCDText(); | 561 raster_source_->CreateCloneWithoutLCDText(); |
| 562 // Synthetically invalidate everything. | 562 // Synthetically invalidate everything. |
| 563 gfx::Rect bounds_rect(bounds()); | 563 gfx::Rect bounds_rect(bounds()); |
| 564 Region invalidation(bounds_rect); | 564 Region invalidation(bounds_rect); |
| 565 UpdateRasterSource(new_raster_source, &invalidation, nullptr); | 565 UpdateRasterSource(new_raster_source, &invalidation, nullptr); |
| 566 SetUpdateRect(bounds_rect); | 566 SetUpdateRect(bounds_rect); |
| 567 | 567 |
| 568 DCHECK(!RasterSourceUsesLCDText()); | 568 DCHECK(!RasterSourceUsesLCDText()); |
| 569 } | 569 } |
| 570 | 570 |
| 571 void PictureLayerImpl::UpdateViewportAfterCommit() { | |
| 572 // When we are using GPU rasterization, the tiling texture size is dependant | |
| 573 // on the viewport size. Here we update the raster source, which in turn | |
| 574 // updates the tiling texture size. | |
| 575 DCHECK(layer_tree_impl()->IsPendingTree()); | |
|
enne (OOO)
2015/03/19 17:55:24
IsSyncTree. Please make sure you have a commit to
danakj
2015/03/19 18:43:38
(Any single thread LayerTreeTest would)
| |
| 576 DCHECK(layer_tree_impl()->use_gpu_rasterization()); | |
| 577 tilings_->UpdateTilingsToCurrentRasterSource( | |
| 578 raster_source_, nullptr, invalidation_, MinimumContentsScale(), | |
| 579 MaximumContentsScale()); | |
| 580 } | |
| 581 | |
| 571 bool PictureLayerImpl::RasterSourceUsesLCDText() const { | 582 bool PictureLayerImpl::RasterSourceUsesLCDText() const { |
| 572 return raster_source_ ? raster_source_->CanUseLCDText() | 583 return raster_source_ ? raster_source_->CanUseLCDText() |
| 573 : layer_tree_impl()->settings().can_use_lcd_text; | 584 : layer_tree_impl()->settings().can_use_lcd_text; |
| 574 } | 585 } |
| 575 | 586 |
| 576 void PictureLayerImpl::NotifyTileStateChanged(const Tile* tile) { | 587 void PictureLayerImpl::NotifyTileStateChanged(const Tile* tile) { |
| 577 if (layer_tree_impl()->IsActiveTree()) { | 588 if (layer_tree_impl()->IsActiveTree()) { |
| 578 gfx::RectF layer_damage_rect = | 589 gfx::RectF layer_damage_rect = |
| 579 gfx::ScaleRect(tile->content_rect(), 1.f / tile->contents_scale()); | 590 gfx::ScaleRect(tile->content_rect(), 1.f / tile->contents_scale()); |
| 580 AddDamageRect(layer_damage_rect); | 591 AddDamageRect(layer_damage_rect); |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1228 | 1239 |
| 1229 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1240 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
| 1230 return !layer_tree_impl()->IsRecycleTree(); | 1241 return !layer_tree_impl()->IsRecycleTree(); |
| 1231 } | 1242 } |
| 1232 | 1243 |
| 1233 bool PictureLayerImpl::HasValidTilePriorities() const { | 1244 bool PictureLayerImpl::HasValidTilePriorities() const { |
| 1234 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1245 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
| 1235 } | 1246 } |
| 1236 | 1247 |
| 1237 } // namespace cc | 1248 } // namespace cc |
| OLD | NEW |