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

Side by Side Diff: cc/resources/picture.cc

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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/resources/picture.h ('k') | cc/resources/picture_layer_tiling_set.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 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/picture.h" 5 #include "cc/resources/picture.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 min_y = std::min(min_y, min.y()); 280 min_y = std::min(min_y, min.y());
281 max_x = std::max(max_x, max.x()); 281 max_x = std::max(max_x, max.x());
282 max_y = std::max(max_y, max.y()); 282 max_y = std::max(max_y, max.y());
283 } 283 }
284 284
285 min_pixel_cell_ = gfx::Point(min_x, min_y); 285 min_pixel_cell_ = gfx::Point(min_x, min_y);
286 max_pixel_cell_ = gfx::Point(max_x, max_y); 286 max_pixel_cell_ = gfx::Point(max_x, max_y);
287 } 287 }
288 288
289 int Picture::Raster(SkCanvas* canvas, 289 int Picture::Raster(SkCanvas* canvas,
290 SkDrawPictureCallback* callback, 290 SkPicture::AbortCallback* callback,
291 const Region& negated_content_region, 291 const Region& negated_content_region,
292 float contents_scale) const { 292 float contents_scale) const {
293 TRACE_EVENT_BEGIN1( 293 TRACE_EVENT_BEGIN1(
294 "cc", 294 "cc",
295 "Picture::Raster", 295 "Picture::Raster",
296 "data", 296 "data",
297 AsTraceableRasterData(contents_scale)); 297 AsTraceableRasterData(contents_scale));
298 298
299 DCHECK(picture_); 299 DCHECK(picture_);
300 300
(...skipping 15 matching lines...) Expand all
316 } 316 }
317 SkIRect bounds; 317 SkIRect bounds;
318 canvas->getClipDeviceBounds(&bounds); 318 canvas->getClipDeviceBounds(&bounds);
319 canvas->restore(); 319 canvas->restore();
320 TRACE_EVENT_END1( 320 TRACE_EVENT_END1(
321 "cc", "Picture::Raster", 321 "cc", "Picture::Raster",
322 "num_pixels_rasterized", bounds.width() * bounds.height()); 322 "num_pixels_rasterized", bounds.width() * bounds.height());
323 return bounds.width() * bounds.height(); 323 return bounds.width() * bounds.height();
324 } 324 }
325 325
326 void Picture::Replay(SkCanvas* canvas) { 326 void Picture::Replay(SkCanvas* canvas, SkPicture::AbortCallback* callback) {
327 TRACE_EVENT_BEGIN0("cc", "Picture::Replay"); 327 TRACE_EVENT_BEGIN0("cc", "Picture::Replay");
328 DCHECK(picture_); 328 DCHECK(picture_);
329 picture_->playback(canvas); 329 picture_->playback(canvas, callback);
330 SkIRect bounds; 330 SkIRect bounds;
331 canvas->getClipDeviceBounds(&bounds); 331 canvas->getClipDeviceBounds(&bounds);
332 TRACE_EVENT_END1("cc", "Picture::Replay", 332 TRACE_EVENT_END1("cc", "Picture::Replay",
333 "num_pixels_replayed", bounds.width() * bounds.height()); 333 "num_pixels_replayed", bounds.width() * bounds.height());
334 } 334 }
335 335
336 scoped_ptr<base::Value> Picture::AsValue() const { 336 scoped_ptr<base::Value> Picture::AsValue() const {
337 // Encode the picture as base64. 337 // Encode the picture as base64.
338 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); 338 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
339 res->Set("params.layer_rect", MathUtil::AsValue(layer_rect_).release()); 339 res->Set("params.layer_rect", MathUtil::AsValue(layer_rect_).release());
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 scoped_refptr<base::trace_event::ConvertableToTraceFormat> 473 scoped_refptr<base::trace_event::ConvertableToTraceFormat>
474 Picture::AsTraceableRecordData() const { 474 Picture::AsTraceableRecordData() const {
475 scoped_refptr<base::trace_event::TracedValue> record_data = 475 scoped_refptr<base::trace_event::TracedValue> record_data =
476 new base::trace_event::TracedValue(); 476 new base::trace_event::TracedValue();
477 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); 477 TracedValue::SetIDRef(this, record_data.get(), "picture_id");
478 MathUtil::AddToTracedValue("layer_rect", layer_rect_, record_data.get()); 478 MathUtil::AddToTracedValue("layer_rect", layer_rect_, record_data.get());
479 return record_data; 479 return record_data;
480 } 480 }
481 481
482 } // namespace cc 482 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_layer_tiling_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698