Index: cc/resources/skpicture_content_layer_updater.cc |
diff --git a/cc/resources/skpicture_content_layer_updater.cc b/cc/resources/skpicture_content_layer_updater.cc |
index b100778275593eae6625d8f20599cb47396ea016..4afeb5a4f4340621fe21013cf6c3dadb13402de7 100644 |
--- a/cc/resources/skpicture_content_layer_updater.cc |
+++ b/cc/resources/skpicture_content_layer_updater.cc |
@@ -27,8 +27,8 @@ void SkPictureContentLayerUpdater::PrepareToUpdate( |
float contents_width_scale, |
float contents_height_scale, |
gfx::Rect* resulting_opaque_rect) { |
- SkCanvas* canvas = |
- picture_.beginRecording(content_rect.width(), content_rect.height()); |
+ SkCanvas* canvas = picture_recorder_.beginRecording(content_rect.width(), |
reed1
2014/04/14 15:19:02
Why does picture_recorder_ have to be a persistent
robertphillips
2014/04/14 15:36:28
Done.
|
+ content_rect.height()); |
DCHECK_EQ(content_rect.width(), canvas->getBaseLayerSize().width()); |
DCHECK_EQ(content_rect.height(), canvas->getBaseLayerSize().height()); |
base::TimeTicks start_time = |
@@ -42,12 +42,13 @@ void SkPictureContentLayerUpdater::PrepareToUpdate( |
rendering_stats_instrumentation_->EndRecording(start_time); |
rendering_stats_instrumentation_->AddRecord( |
duration, content_rect.width() * content_rect.height()); |
- picture_.endRecording(); |
+ picture_ = skia::AdoptRef(picture_recorder_.endRecording()); |
} |
void SkPictureContentLayerUpdater::DrawPicture(SkCanvas* canvas) { |
TRACE_EVENT0("cc", "SkPictureContentLayerUpdater::DrawPicture"); |
- canvas->drawPicture(picture_); |
+ if (picture_) |
+ canvas->drawPicture(*picture_); |
} |
} // namespace cc |