| 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/tile_manager.h" | 5 #include "cc/resources/tile_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "cc/debug/debug_colors.h" |
| 14 #include "cc/debug/devtools_instrumentation.h" | 15 #include "cc/debug/devtools_instrumentation.h" |
| 15 #include "cc/debug/traced_value.h" | 16 #include "cc/debug/traced_value.h" |
| 16 #include "cc/resources/raster_worker_pool.h" | 17 #include "cc/resources/raster_worker_pool.h" |
| 17 #include "cc/resources/resource_pool.h" | 18 #include "cc/resources/resource_pool.h" |
| 18 #include "cc/resources/tile.h" | 19 #include "cc/resources/tile.h" |
| 19 #include "third_party/skia/include/core/SkDevice.h" | 20 #include "third_party/skia/include/core/SkDevice.h" |
| 20 | 21 |
| 21 namespace cc { | 22 namespace cc { |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 | 901 |
| 901 if (analysis->is_solid_color) | 902 if (analysis->is_solid_color) |
| 902 return; | 903 return; |
| 903 | 904 |
| 904 SkBitmap bitmap; | 905 SkBitmap bitmap; |
| 905 bitmap.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height()); | 906 bitmap.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height()); |
| 906 bitmap.setPixels(buffer); | 907 bitmap.setPixels(buffer); |
| 907 SkDevice device(bitmap); | 908 SkDevice device(bitmap); |
| 908 SkCanvas canvas(&device); | 909 SkCanvas canvas(&device); |
| 909 | 910 |
| 911 #ifndef NDEBUG |
| 912 // Any non-painted areas will be left in this color. |
| 913 canvas.clear(DebugColors::NonPaintedFillColor()); |
| 914 #endif // NDEBUG |
| 915 |
| 910 if (stats_instrumentation->record_rendering_stats()) { | 916 if (stats_instrumentation->record_rendering_stats()) { |
| 911 PicturePileImpl::RasterStats raster_stats; | 917 PicturePileImpl::RasterStats raster_stats; |
| 912 picture_pile->Raster(&canvas, rect, contents_scale, &raster_stats); | 918 picture_pile->Raster(&canvas, rect, contents_scale, &raster_stats); |
| 913 stats_instrumentation->AddRaster( | 919 stats_instrumentation->AddRaster( |
| 914 raster_stats.total_rasterize_time, | 920 raster_stats.total_rasterize_time, |
| 915 raster_stats.best_rasterize_time, | 921 raster_stats.best_rasterize_time, |
| 916 raster_stats.total_pixels_rasterized, | 922 raster_stats.total_pixels_rasterized, |
| 917 metadata.is_tile_in_pending_tree_now_bin); | 923 metadata.is_tile_in_pending_tree_now_bin); |
| 918 | 924 |
| 919 HISTOGRAM_CUSTOM_COUNTS( | 925 HISTOGRAM_CUSTOM_COUNTS( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 is_predicted_solid && predicted_color != actual_color); | 972 is_predicted_solid && predicted_color != actual_color); |
| 967 HISTOGRAM_BOOLEAN("Renderer4.ColorPredictor.Accuracy", | 973 HISTOGRAM_BOOLEAN("Renderer4.ColorPredictor.Accuracy", |
| 968 is_predicted_solid == is_actually_solid && | 974 is_predicted_solid == is_actually_solid && |
| 969 (!is_predicted_solid || predicted_color == actual_color)); | 975 (!is_predicted_solid || predicted_color == actual_color)); |
| 970 HISTOGRAM_BOOLEAN("Renderer4.ColorPredictor.IsCorrectSolid", | 976 HISTOGRAM_BOOLEAN("Renderer4.ColorPredictor.IsCorrectSolid", |
| 971 is_predicted_solid == is_actually_solid && | 977 is_predicted_solid == is_actually_solid && |
| 972 (is_predicted_solid && predicted_color == actual_color)); | 978 (is_predicted_solid && predicted_color == actual_color)); |
| 973 } | 979 } |
| 974 | 980 |
| 975 } // namespace cc | 981 } // namespace cc |
| OLD | NEW |