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

Side by Side Diff: cc/playback/display_item_list.cc

Issue 1158433010: Reland: cc: Fix size_t to int truncations in layers/ output/ playback/ quads/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/playback/display_item_list.h" 5 #include "cc/playback/display_item_list.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 DCHECK_IMPLIES(use_cached_picture_, picture_); 184 DCHECK_IMPLIES(use_cached_picture_, picture_);
185 return picture_memory_usage_; 185 return picture_memory_usage_;
186 } 186 }
187 187
188 scoped_refptr<base::trace_event::ConvertableToTraceFormat> 188 scoped_refptr<base::trace_event::ConvertableToTraceFormat>
189 DisplayItemList::AsValue() const { 189 DisplayItemList::AsValue() const {
190 DCHECK(ProcessAppendedItemsCalled()); 190 DCHECK(ProcessAppendedItemsCalled());
191 scoped_refptr<base::trace_event::TracedValue> state = 191 scoped_refptr<base::trace_event::TracedValue> state =
192 new base::trace_event::TracedValue(); 192 new base::trace_event::TracedValue();
193 193
194 state->SetInteger("length", items_.size()); 194 state->SetInteger("length", static_cast<int>(items_.size()));
195 state->BeginArray("params.items"); 195 state->BeginArray("params.items");
196 for (const DisplayItem* item : items_) { 196 for (const DisplayItem* item : items_) {
197 item->AsValueInto(state.get()); 197 item->AsValueInto(state.get());
198 } 198 }
199 state->EndArray(); 199 state->EndArray();
200 state->SetValue("params.layer_rect", MathUtil::AsValue(layer_rect_)); 200 state->SetValue("params.layer_rect", MathUtil::AsValue(layer_rect_));
201 201
202 if (!layer_rect_.IsEmpty()) { 202 if (!layer_rect_.IsEmpty()) {
203 SkPictureRecorder recorder; 203 SkPictureRecorder recorder;
204 SkCanvas* canvas = 204 SkCanvas* canvas =
(...skipping 25 matching lines...) Expand all
230 // This should be only called once, and only after CreateAndCacheSkPicture. 230 // This should be only called once, and only after CreateAndCacheSkPicture.
231 DCHECK(picture_); 231 DCHECK(picture_);
232 DCHECK(!pixel_refs_); 232 DCHECK(!pixel_refs_);
233 pixel_refs_ = make_scoped_ptr(new PixelRefMap(grid_cell_size)); 233 pixel_refs_ = make_scoped_ptr(new PixelRefMap(grid_cell_size));
234 if (!picture_->willPlayBackBitmaps()) 234 if (!picture_->willPlayBackBitmaps())
235 return; 235 return;
236 236
237 pixel_refs_->GatherPixelRefsFromPicture(picture_.get()); 237 pixel_refs_->GatherPixelRefsFromPicture(picture_.get());
238 } 238 }
239 } // namespace cc 239 } // namespace cc
OLDNEW
« cc/layers/layer.cc ('K') | « cc/output/gl_renderer.cc ('k') | cc/quads/render_pass.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698