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/resources/picture_pile.h" | 5 #include "cc/resources/picture_pile.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 DCHECK(found_tile_for_recorded_picture); | 531 DCHECK(found_tile_for_recorded_picture); |
532 } | 532 } |
533 | 533 |
534 has_any_recordings_ = true; | 534 has_any_recordings_ = true; |
535 DCHECK(CanRasterSlowTileCheck(recorded_viewport_)); | 535 DCHECK(CanRasterSlowTileCheck(recorded_viewport_)); |
536 return true; | 536 return true; |
537 } | 537 } |
538 | 538 |
539 void PicturePile::SetEmptyBounds() { | 539 void PicturePile::SetEmptyBounds() { |
540 tiling_.SetTilingSize(gfx::Size()); | 540 tiling_.SetTilingSize(gfx::Size()); |
541 picture_map_.clear(); | 541 Clear(); |
542 has_any_recordings_ = false; | |
543 recorded_viewport_ = gfx::Rect(); | |
544 } | 542 } |
545 | 543 |
546 void PicturePile::DetermineIfSolidColor() { | 544 void PicturePile::DetermineIfSolidColor() { |
547 is_solid_color_ = false; | 545 is_solid_color_ = false; |
548 solid_color_ = SK_ColorTRANSPARENT; | 546 solid_color_ = SK_ColorTRANSPARENT; |
549 | 547 |
550 if (picture_map_.empty()) { | 548 if (picture_map_.empty()) { |
551 return; | 549 return; |
552 } | 550 } |
553 | 551 |
(...skipping 15 matching lines...) Expand all Loading... |
569 return; | 567 return; |
570 } | 568 } |
571 skia::AnalysisCanvas canvas(recorded_viewport_.width(), | 569 skia::AnalysisCanvas canvas(recorded_viewport_.width(), |
572 recorded_viewport_.height()); | 570 recorded_viewport_.height()); |
573 canvas.translate(-recorded_viewport_.x(), -recorded_viewport_.y()); | 571 canvas.translate(-recorded_viewport_.x(), -recorded_viewport_.y()); |
574 picture->Raster(&canvas, nullptr, Region(), 1.0f); | 572 picture->Raster(&canvas, nullptr, Region(), 1.0f); |
575 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 573 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
576 } | 574 } |
577 | 575 |
578 } // namespace cc | 576 } // namespace cc |
OLD | NEW |