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

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 853393002: cc: refactor of MathUtil::AddToTracedValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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 | « cc/layers/layer_impl.cc ('k') | cc/layers/tiled_layer_impl.cc » ('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 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/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 } 1172 }
1173 1173
1174 void PictureLayerImpl::AsValueInto(base::debug::TracedValue* state) const { 1174 void PictureLayerImpl::AsValueInto(base::debug::TracedValue* state) const {
1175 LayerImpl::AsValueInto(state); 1175 LayerImpl::AsValueInto(state);
1176 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); 1176 state->SetDouble("ideal_contents_scale", ideal_contents_scale_);
1177 state->SetDouble("geometry_contents_scale", MaximumTilingContentsScale()); 1177 state->SetDouble("geometry_contents_scale", MaximumTilingContentsScale());
1178 state->BeginArray("tilings"); 1178 state->BeginArray("tilings");
1179 tilings_->AsValueInto(state); 1179 tilings_->AsValueInto(state);
1180 state->EndArray(); 1180 state->EndArray();
1181 1181
1182 state->BeginArray("tile_priority_rect"); 1182 MathUtil::AddToTracedValue("tile_priority_rect",
1183 MathUtil::AddToTracedValue(GetViewportForTilePriorityInContentSpace(), state); 1183 GetViewportForTilePriorityInContentSpace(), state);
1184 state->EndArray();
1185 1184
1186 state->BeginArray("visible_rect"); 1185 MathUtil::AddToTracedValue("visible_rect", visible_content_rect(), state);
1187 MathUtil::AddToTracedValue(visible_content_rect(), state);
1188 state->EndArray();
1189 1186
1190 state->BeginArray("pictures"); 1187 state->BeginArray("pictures");
1191 raster_source_->AsValueInto(state); 1188 raster_source_->AsValueInto(state);
1192 state->EndArray(); 1189 state->EndArray();
1193 1190
1194 state->BeginArray("invalidation"); 1191 state->BeginArray("invalidation");
1195 invalidation_.AsValueInto(state); 1192 invalidation_.AsValueInto(state);
1196 state->EndArray(); 1193 state->EndArray();
1197 1194
1198 state->BeginArray("coverage_tiles"); 1195 state->BeginArray("coverage_tiles");
1199 for (PictureLayerTilingSet::CoverageIterator iter( 1196 for (PictureLayerTilingSet::CoverageIterator iter(
1200 tilings_.get(), 1.f, gfx::Rect(raster_source_->GetSize()), 1197 tilings_.get(), 1.f, gfx::Rect(raster_source_->GetSize()),
1201 ideal_contents_scale_); 1198 ideal_contents_scale_);
1202 iter; ++iter) { 1199 iter; ++iter) {
1203 state->BeginDictionary(); 1200 state->BeginDictionary();
1204 1201
1205 state->BeginArray("geometry_rect"); 1202 MathUtil::AddToTracedValue("geometry_rect", iter.geometry_rect(), state);
1206 MathUtil::AddToTracedValue(iter.geometry_rect(), state);
1207 state->EndArray();
1208 1203
1209 if (*iter) 1204 if (*iter)
1210 TracedValue::SetIDRef(*iter, state, "tile"); 1205 TracedValue::SetIDRef(*iter, state, "tile");
1211 1206
1212 state->EndDictionary(); 1207 state->EndDictionary();
1213 } 1208 }
1214 state->EndArray(); 1209 state->EndArray();
1215 } 1210 }
1216 1211
1217 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { 1212 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 1287
1293 bool PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw() const { 1288 bool PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw() const {
1294 if (!layer_tree_impl()->IsActiveTree()) 1289 if (!layer_tree_impl()->IsActiveTree())
1295 return true; 1290 return true;
1296 1291
1297 return AllTilesRequiredAreReadyToDraw( 1292 return AllTilesRequiredAreReadyToDraw(
1298 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); 1293 &PictureLayerTiling::IsTileRequiredForDrawIfVisible);
1299 } 1294 }
1300 1295
1301 } // namespace cc 1296 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/tiled_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698