Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: cc/debug/rasterize_and_record_benchmark_impl.cc

Issue 820703002: c:: Give the raster source to the PictureLayerTilings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rastersource: . Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 }; 88 };
89 89
90 class FixedInvalidationPictureLayerTilingClient 90 class FixedInvalidationPictureLayerTilingClient
91 : public PictureLayerTilingClient { 91 : public PictureLayerTilingClient {
92 public: 92 public:
93 FixedInvalidationPictureLayerTilingClient( 93 FixedInvalidationPictureLayerTilingClient(
94 PictureLayerTilingClient* base_client, 94 PictureLayerTilingClient* base_client,
95 const Region invalidation) 95 const Region invalidation)
96 : base_client_(base_client), invalidation_(invalidation) {} 96 : base_client_(base_client), invalidation_(invalidation) {}
97 97
98 scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling, 98 scoped_refptr<Tile> CreateTile(float contents_scale,
99 const gfx::Rect& content_rect) override { 99 const gfx::Rect& content_rect) override {
100 return base_client_->CreateTile(tiling, content_rect); 100 return base_client_->CreateTile(contents_scale, content_rect);
101 } 101 }
102 102
103 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override { 103 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override {
104 return base_client_->CalculateTileSize(content_bounds); 104 return base_client_->CalculateTileSize(content_bounds);
105 } 105 }
106 106
107 // This is the only function that returns something different from the base 107 // This is the only function that returns something different from the base
108 // client. Avoids sharing tiles in this area. 108 // client. Avoids sharing tiles in this area.
109 const Region* GetPendingInvalidation() override { return &invalidation_; } 109 const Region* GetPendingInvalidation() override { return &invalidation_; }
110 110
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 // In this benchmark, we will create a local tiling set and measure how long 208 // In this benchmark, we will create a local tiling set and measure how long
209 // it takes to rasterize content. As such, the actual settings used here don't 209 // it takes to rasterize content. As such, the actual settings used here don't
210 // really matter. 210 // really matter.
211 const LayerTreeSettings& settings = layer->layer_tree_impl()->settings(); 211 const LayerTreeSettings& settings = layer->layer_tree_impl()->settings();
212 auto tiling_set = PictureLayerTilingSet::Create( 212 auto tiling_set = PictureLayerTilingSet::Create(
213 &client, settings.max_tiles_for_interest_area, 213 &client, settings.max_tiles_for_interest_area,
214 settings.skewport_target_time_in_seconds, 214 settings.skewport_target_time_in_seconds,
215 settings.skewport_extrapolation_limit_in_content_pixels); 215 settings.skewport_extrapolation_limit_in_content_pixels);
216 216
217 PictureLayerTiling* tiling = 217 PictureLayerTiling* tiling = tiling_set->AddTiling(layer->contents_scale_x(),
218 tiling_set->AddTiling(layer->contents_scale_x(), layer->bounds()); 218 layer->GetRasterSource());
219 tiling->CreateAllTilesForTesting(); 219 tiling->CreateAllTilesForTesting();
220 for (PictureLayerTiling::CoverageIterator it( 220 for (PictureLayerTiling::CoverageIterator it(
221 tiling, layer->contents_scale_x(), layer->visible_content_rect()); 221 tiling, layer->contents_scale_x(), layer->visible_content_rect());
222 it; 222 it;
223 ++it) { 223 ++it) {
224 DCHECK(*it); 224 DCHECK(*it);
225 225
226 RasterSource* raster_source = (*it)->raster_source(); 226 RasterSource* raster_source = (*it)->raster_source();
227 gfx::Rect content_rect = (*it)->content_rect(); 227 gfx::Rect content_rect = (*it)->content_rect();
228 float contents_scale = (*it)->contents_scale(); 228 float contents_scale = (*it)->contents_scale();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 total_memory_usage(0), 274 total_memory_usage(0),
275 total_layers(0), 275 total_layers(0),
276 total_picture_layers(0), 276 total_picture_layers(0),
277 total_picture_layers_with_no_content(0), 277 total_picture_layers_with_no_content(0),
278 total_picture_layers_off_screen(0) { 278 total_picture_layers_off_screen(0) {
279 } 279 }
280 280
281 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} 281 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {}
282 282
283 } // namespace cc 283 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698