| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/debug/rasterize_and_record_benchmark_impl.h" | 5 #include "cc/debug/rasterize_and_record_benchmark_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 for (PictureLayerTiling::CoverageIterator it( | 76 for (PictureLayerTiling::CoverageIterator it( |
| 77 tiling, layer->contents_scale_x(), layer->visible_content_rect()); | 77 tiling, layer->contents_scale_x(), layer->visible_content_rect()); |
| 78 it; | 78 it; |
| 79 ++it) { | 79 ++it) { |
| 80 DCHECK(*it); | 80 DCHECK(*it); |
| 81 | 81 |
| 82 PicturePileImpl* picture_pile = (*it)->picture_pile(); | 82 PicturePileImpl* picture_pile = (*it)->picture_pile(); |
| 83 gfx::Rect content_rect = (*it)->content_rect(); | 83 gfx::Rect content_rect = (*it)->content_rect(); |
| 84 float contents_scale = (*it)->contents_scale(); | 84 float contents_scale = (*it)->contents_scale(); |
| 85 | 85 |
| 86 base::TimeDelta min_time = | 86 base::TimeDelta min_time = base::TimeDelta::Max(); |
| 87 base::TimeDelta::FromInternalValue(std::numeric_limits<int64>::max()); | |
| 88 for (int i = 0; i < rasterize_repeat_count_; ++i) { | 87 for (int i = 0; i < rasterize_repeat_count_; ++i) { |
| 89 SkBitmap bitmap; | 88 SkBitmap bitmap; |
| 90 bitmap.setConfig(SkBitmap::kARGB_8888_Config, | 89 bitmap.setConfig(SkBitmap::kARGB_8888_Config, |
| 91 content_rect.width(), | 90 content_rect.width(), |
| 92 content_rect.height()); | 91 content_rect.height()); |
| 93 bitmap.allocPixels(); | 92 bitmap.allocPixels(); |
| 94 | 93 |
| 95 SkBitmapDevice device(bitmap); | 94 SkBitmapDevice device(bitmap); |
| 96 SkCanvas canvas(&device); | 95 SkCanvas canvas(&device); |
| 97 PicturePileImpl::Analysis analysis; | 96 PicturePileImpl::Analysis analysis; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 111 rasterize_results_.total_best_time += min_time; | 110 rasterize_results_.total_best_time += min_time; |
| 112 } | 111 } |
| 113 } | 112 } |
| 114 | 113 |
| 115 RasterizeAndRecordBenchmarkImpl::RasterizeResults::RasterizeResults() | 114 RasterizeAndRecordBenchmarkImpl::RasterizeResults::RasterizeResults() |
| 116 : pixels_rasterized(0) {} | 115 : pixels_rasterized(0) {} |
| 117 | 116 |
| 118 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} | 117 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} |
| 119 | 118 |
| 120 } // namespace cc | 119 } // namespace cc |
| OLD | NEW |