| 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 | 664 |
| 665 bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW; | 665 bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW; |
| 666 if (!tile->is_solid_color_analysis_performed() && | 666 if (!tile->is_solid_color_analysis_performed() && |
| 667 tile->use_picture_analysis() && kUseColorEstimator) { | 667 tile->use_picture_analysis() && kUseColorEstimator) { |
| 668 // We analyze for solid color here, to decide to continue | 668 // We analyze for solid color here, to decide to continue |
| 669 // or drop the tile for scheduling and raster. | 669 // or drop the tile for scheduling and raster. |
| 670 // TODO(sohanjg): Check if we could use a shared analysis | 670 // TODO(sohanjg): Check if we could use a shared analysis |
| 671 // canvas which is reset between tiles. | 671 // canvas which is reset between tiles. |
| 672 tile->set_solid_color_analysis_performed(true); | 672 tile->set_solid_color_analysis_performed(true); |
| 673 SkColor color = SK_ColorTRANSPARENT; | 673 SkColor color = SK_ColorTRANSPARENT; |
| 674 gfx::RectF layer_rect = tile->raster_transform().InverseMapRect( | 674 |
| 675 gfx::RectF(tile->content_rect())); | |
| 676 bool is_solid_color = | 675 bool is_solid_color = |
| 677 prioritized_tile.raster_source()->PerformSolidColorAnalysis( | 676 prioritized_tile.raster_source()->PerformSolidColorAnalysis( |
| 678 gfx::ToEnclosingRect(layer_rect), 1.f, &color); | 677 tile->content_rect(), tile->raster_transform().scale(), &color); |
| 679 if (is_solid_color) { | 678 if (is_solid_color) { |
| 680 tile->draw_info().set_solid_color(color); | 679 tile->draw_info().set_solid_color(color); |
| 681 client_->NotifyTileStateChanged(tile); | 680 client_->NotifyTileStateChanged(tile); |
| 682 continue; | 681 continue; |
| 683 } | 682 } |
| 684 } | 683 } |
| 685 | 684 |
| 686 // Prepaint tiles that are far away are only processed for images. | 685 // Prepaint tiles that are far away are only processed for images. |
| 687 if (!tile->required_for_activation() && !tile->required_for_draw() && | 686 if (!tile->required_for_activation() && !tile->required_for_draw() && |
| 688 prioritized_tile.is_process_for_images_only()) { | 687 prioritized_tile.is_process_for_images_only()) { |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 all_tile_tasks_completed = false; | 1640 all_tile_tasks_completed = false; |
| 1642 did_notify_all_tile_tasks_completed = false; | 1641 did_notify_all_tile_tasks_completed = false; |
| 1643 } | 1642 } |
| 1644 | 1643 |
| 1645 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1644 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
| 1646 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1645 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
| 1647 PrioritizedWorkToSchedule&& other) = default; | 1646 PrioritizedWorkToSchedule&& other) = default; |
| 1648 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1647 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
| 1649 | 1648 |
| 1650 } // namespace cc | 1649 } // namespace cc |
| OLD | NEW |