Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 | 343 |
| 344 canvas->save(); | 344 canvas->save(); |
| 345 | 345 |
| 346 for (Region::Iterator it(negated_content_region); it.has_rect(); it.next()) | 346 for (Region::Iterator it(negated_content_region); it.has_rect(); it.next()) |
| 347 canvas->clipRect(gfx::RectToSkRect(it.rect()), SkRegion::kDifference_Op); | 347 canvas->clipRect(gfx::RectToSkRect(it.rect()), SkRegion::kDifference_Op); |
| 348 | 348 |
| 349 canvas->scale(contents_scale, contents_scale); | 349 canvas->scale(contents_scale, contents_scale); |
| 350 canvas->translate(layer_rect_.x(), layer_rect_.y()); | 350 canvas->translate(layer_rect_.x(), layer_rect_.y()); |
| 351 if (playback_) { | 351 if (playback_) { |
| 352 playback_->draw(canvas); | 352 playback_->draw(canvas); |
| 353 } else if (callback) { | |
| 354 picture_->draw(canvas, callback); // AnalysisCanvas | |
| 353 } else { | 355 } else { |
| 354 picture_->draw(canvas, callback); | 356 canvas->drawPicture(picture_.get()); |
| 355 } | 357 } |
|
reveman
2014/09/22 21:29:05
I assume this is the fix for picture ops being bei
hendrikw
2014/09/22 21:48:39
I'd rather not separate these. I can put more det
reveman
2014/09/22 22:41:08
Ok, a comment here would be useful as it's not obv
robertphillips
2014/09/23 12:54:55
We have renamed SkPicture::draw to be SkPicture::p
reveman
2014/09/23 14:59:46
Ok, that makes sense. We should probably change th
| |
| 356 SkIRect bounds; | 358 SkIRect bounds; |
| 357 canvas->getClipDeviceBounds(&bounds); | 359 canvas->getClipDeviceBounds(&bounds); |
| 358 canvas->restore(); | 360 canvas->restore(); |
| 359 TRACE_EVENT_END1( | 361 TRACE_EVENT_END1( |
| 360 "cc", "Picture::Raster", | 362 "cc", "Picture::Raster", |
| 361 "num_pixels_rasterized", bounds.width() * bounds.height()); | 363 "num_pixels_rasterized", bounds.width() * bounds.height()); |
| 362 return bounds.width() * bounds.height(); | 364 return bounds.width() * bounds.height(); |
| 363 } | 365 } |
| 364 | 366 |
| 365 void Picture::Replay(SkCanvas* canvas) { | 367 void Picture::Replay(SkCanvas* canvas) { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 541 scoped_refptr<base::debug::TracedValue> record_data = | 543 scoped_refptr<base::debug::TracedValue> record_data = |
| 542 new base::debug::TracedValue(); | 544 new base::debug::TracedValue(); |
| 543 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 545 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
| 544 record_data->BeginArray("layer_rect"); | 546 record_data->BeginArray("layer_rect"); |
| 545 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | 547 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); |
| 546 record_data->EndArray(); | 548 record_data->EndArray(); |
| 547 return record_data; | 549 return record_data; |
| 548 } | 550 } |
| 549 | 551 |
| 550 } // namespace cc | 552 } // namespace cc |
| OLD | NEW |