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/tiles/tile_manager.h" | 5 #include "cc/tiles/tile_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 | 668 |
669 bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW; | 669 bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW; |
670 if (!tile->is_solid_color_analysis_performed() && | 670 if (!tile->is_solid_color_analysis_performed() && |
671 tile->use_picture_analysis() && kUseColorEstimator) { | 671 tile->use_picture_analysis() && kUseColorEstimator) { |
672 // We analyze for solid color here, to decide to continue | 672 // We analyze for solid color here, to decide to continue |
673 // or drop the tile for scheduling and raster. | 673 // or drop the tile for scheduling and raster. |
674 // TODO(sohanjg): Check if we could use a shared analysis | 674 // TODO(sohanjg): Check if we could use a shared analysis |
675 // canvas which is reset between tiles. | 675 // canvas which is reset between tiles. |
676 tile->set_solid_color_analysis_performed(true); | 676 tile->set_solid_color_analysis_performed(true); |
677 SkColor color = SK_ColorTRANSPARENT; | 677 SkColor color = SK_ColorTRANSPARENT; |
678 gfx::RectF layer_rect = tile->raster_transform().InverseMapRect( | 678 |
679 gfx::RectF(tile->content_rect())); | |
680 bool is_solid_color = | 679 bool is_solid_color = |
681 prioritized_tile.raster_source()->PerformSolidColorAnalysis( | 680 prioritized_tile.raster_source()->PerformSolidColorAnalysis( |
682 gfx::ToEnclosingRect(layer_rect), 1.f, &color); | 681 tile->content_rect(), tile->raster_transform(), &color); |
683 if (is_solid_color) { | 682 if (is_solid_color) { |
684 tile->draw_info().set_solid_color(color); | 683 tile->draw_info().set_solid_color(color); |
685 client_->NotifyTileStateChanged(tile); | 684 client_->NotifyTileStateChanged(tile); |
686 continue; | 685 continue; |
687 } | 686 } |
688 } | 687 } |
689 | 688 |
690 // Prepaint tiles that are far away are only processed for images. | 689 // Prepaint tiles that are far away are only processed for images. |
691 if (!tile->required_for_activation() && !tile->required_for_draw() && | 690 if (!tile->required_for_activation() && !tile->required_for_draw() && |
692 prioritized_tile.is_process_for_images_only()) { | 691 prioritized_tile.is_process_for_images_only()) { |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 all_tile_tasks_completed = false; | 1655 all_tile_tasks_completed = false; |
1657 did_notify_all_tile_tasks_completed = false; | 1656 did_notify_all_tile_tasks_completed = false; |
1658 } | 1657 } |
1659 | 1658 |
1660 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1659 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
1661 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1660 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
1662 PrioritizedWorkToSchedule&& other) = default; | 1661 PrioritizedWorkToSchedule&& other) = default; |
1663 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1662 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
1664 | 1663 |
1665 } // namespace cc | 1664 } // namespace cc |
OLD | NEW |