| 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 TilePriority priority = prioritized_tile.priority(); | 625 TilePriority priority = prioritized_tile.priority(); |
| 626 | 626 |
| 627 if (TilePriorityViolatesMemoryPolicy(priority)) { | 627 if (TilePriorityViolatesMemoryPolicy(priority)) { |
| 628 TRACE_EVENT_INSTANT0( | 628 TRACE_EVENT_INSTANT0( |
| 629 "cc", "TileManager::AssignGpuMemory tile violates memory policy", | 629 "cc", "TileManager::AssignGpuMemory tile violates memory policy", |
| 630 TRACE_EVENT_SCOPE_THREAD); | 630 TRACE_EVENT_SCOPE_THREAD); |
| 631 break; | 631 break; |
| 632 } | 632 } |
| 633 | 633 |
| 634 bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW; | 634 bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW; |
| 635 if (tile->use_picture_analysis() && kUseColorEstimator) { | 635 if (!tile->is_solid_color_analysis_performed() && |
| 636 tile->use_picture_analysis() && kUseColorEstimator) { |
| 636 // We analyze for solid color here, to decide to continue | 637 // We analyze for solid color here, to decide to continue |
| 637 // or drop the tile for scheduling and raster. | 638 // or drop the tile for scheduling and raster. |
| 638 // TODO(sohanjg): Check if we could use a shared analysis | 639 // TODO(sohanjg): Check if we could use a shared analysis |
| 639 // canvas which is reset between tiles. | 640 // canvas which is reset between tiles. |
| 641 tile->set_solid_color_analysis_performed(true); |
| 640 SkColor color = SK_ColorTRANSPARENT; | 642 SkColor color = SK_ColorTRANSPARENT; |
| 641 bool is_solid_color = | 643 bool is_solid_color = |
| 642 prioritized_tile.raster_source()->PerformSolidColorAnalysis( | 644 prioritized_tile.raster_source()->PerformSolidColorAnalysis( |
| 643 tile->content_rect(), tile->contents_scale(), &color); | 645 tile->content_rect(), tile->contents_scale(), &color); |
| 644 if (is_solid_color) { | 646 if (is_solid_color) { |
| 645 tile->draw_info().set_solid_color(color); | 647 tile->draw_info().set_solid_color(color); |
| 646 tile->draw_info().set_was_ever_ready_to_draw(); | 648 tile->draw_info().set_was_ever_ready_to_draw(); |
| 647 if (!tile_is_needed_now) | 649 if (!tile_is_needed_now) |
| 648 tile->draw_info().set_was_a_prepaint_tile(); | 650 tile->draw_info().set_was_a_prepaint_tile(); |
| 649 client_->NotifyTileStateChanged(tile); | 651 client_->NotifyTileStateChanged(tile); |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 all_tile_tasks_completed = false; | 1332 all_tile_tasks_completed = false; |
| 1331 did_notify_all_tile_tasks_completed = false; | 1333 did_notify_all_tile_tasks_completed = false; |
| 1332 } | 1334 } |
| 1333 | 1335 |
| 1334 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1336 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
| 1335 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1337 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
| 1336 PrioritizedWorkToSchedule&& other) = default; | 1338 PrioritizedWorkToSchedule&& other) = default; |
| 1337 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1339 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
| 1338 | 1340 |
| 1339 } // namespace cc | 1341 } // namespace cc |
| OLD | NEW |