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

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

Issue 126343003: Revert of cc: Combine analysis and raster (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_pile_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 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 max_x = std::max(max_x, max.x()); 291 max_x = std::max(max_x, max.x());
292 max_y = std::max(max_y, max.y()); 292 max_y = std::max(max_y, max.y());
293 } 293 }
294 294
295 min_pixel_cell_ = gfx::Point(min_x, min_y); 295 min_pixel_cell_ = gfx::Point(min_x, min_y);
296 max_pixel_cell_ = gfx::Point(max_x, max_y); 296 max_pixel_cell_ = gfx::Point(max_x, max_y);
297 } 297 }
298 298
299 int Picture::Raster( 299 int Picture::Raster(
300 SkCanvas* canvas, 300 SkCanvas* canvas,
301 SkDrawPictureCallback* callback,
301 const Region& negated_content_region, 302 const Region& negated_content_region,
302 float contents_scale) { 303 float contents_scale) {
303 TRACE_EVENT_BEGIN1( 304 TRACE_EVENT_BEGIN1(
304 "cc", 305 "cc",
305 "Picture::Raster", 306 "Picture::Raster",
306 "data", 307 "data",
307 AsTraceableRasterData(contents_scale)); 308 AsTraceableRasterData(contents_scale));
308 309
309 DCHECK(picture_); 310 DCHECK(picture_);
310 311
311 canvas->save(); 312 canvas->save();
312 313
313 for (Region::Iterator it(negated_content_region); it.has_rect(); it.next()) 314 for (Region::Iterator it(negated_content_region); it.has_rect(); it.next())
314 canvas->clipRect(gfx::RectToSkRect(it.rect()), SkRegion::kDifference_Op); 315 canvas->clipRect(gfx::RectToSkRect(it.rect()), SkRegion::kDifference_Op);
315 316
316 canvas->scale(contents_scale, contents_scale); 317 canvas->scale(contents_scale, contents_scale);
317 canvas->translate(layer_rect_.x(), layer_rect_.y()); 318 canvas->translate(layer_rect_.x(), layer_rect_.y());
318 picture_->draw(canvas); 319 picture_->draw(canvas, callback);
319 SkIRect bounds; 320 SkIRect bounds;
320 canvas->getClipDeviceBounds(&bounds); 321 canvas->getClipDeviceBounds(&bounds);
321 canvas->restore(); 322 canvas->restore();
322 TRACE_EVENT_END1( 323 TRACE_EVENT_END1(
323 "cc", "Picture::Raster", 324 "cc", "Picture::Raster",
324 "num_pixels_rasterized", bounds.width() * bounds.height()); 325 "num_pixels_rasterized", bounds.width() * bounds.height());
325 return bounds.width() * bounds.height(); 326 return bounds.width() * bounds.height();
326 } 327 }
327 328
328 void Picture::Replay(SkCanvas* canvas) { 329 void Picture::Replay(SkCanvas* canvas) {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 scoped_refptr<base::debug::ConvertableToTraceFormat> 481 scoped_refptr<base::debug::ConvertableToTraceFormat>
481 Picture::AsTraceableRecordData() const { 482 Picture::AsTraceableRecordData() const {
482 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); 483 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue());
483 record_data->Set("picture_id", TracedValue::CreateIDRef(this).release()); 484 record_data->Set("picture_id", TracedValue::CreateIDRef(this).release());
484 record_data->SetInteger("width", layer_rect_.width()); 485 record_data->SetInteger("width", layer_rect_.width());
485 record_data->SetInteger("height", layer_rect_.height()); 486 record_data->SetInteger("height", layer_rect_.height());
486 return TracedValue::FromValue(record_data.release()); 487 return TracedValue::FromValue(record_data.release());
487 } 488 }
488 489
489 } // namespace cc 490 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698