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

Unified Diff: cc/resources/picture.cc

Issue 664583002: Remove obsolete SkRecord preview code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update r&r micro, and format Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture.cc
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index 6fa5abcabf203e4bfddcb99d3e72856155e98f3f..d9b10be1f016a7da876a76bf48637c4828105e09 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -214,8 +214,6 @@ void Picture::Record(ContentLayerClient* painter,
SkTileGridFactory factory(tile_grid_info);
SkPictureRecorder recorder;
- scoped_ptr<EXPERIMENTAL::SkRecording> recording;
-
skia::RefPtr<SkCanvas> canvas;
canvas = skia::SharePtr(recorder.beginRecording(
layer_rect_.width(), layer_rect_.height(), &factory));
@@ -238,11 +236,6 @@ void Picture::Record(ContentLayerClient* painter,
canvas = skia::AdoptRef(SkCreateNullCanvas());
graphics_context_status = ContentLayerClient::GRAPHICS_CONTEXT_DISABLED;
break;
- case RECORD_WITH_SKRECORD:
- recording.reset(new EXPERIMENTAL::SkRecording(layer_rect_.width(),
- layer_rect_.height()));
- canvas = skia::SharePtr(recording->canvas());
- break;
default:
NOTREACHED();
}
@@ -263,13 +256,6 @@ void Picture::Record(ContentLayerClient* painter,
picture_ = skia::AdoptRef(recorder.endRecording());
DCHECK(picture_);
- if (recording) {
- // SkRecording requires it's the only one holding onto canvas before we
- // may call releasePlayback(). (This helps enforce thread-safety.)
- canvas.clear();
- playback_.reset(recording->releasePlayback());
- }
-
EmitTraceSnapshot();
}
@@ -348,9 +334,7 @@ int Picture::Raster(SkCanvas* canvas,
canvas->scale(contents_scale, contents_scale);
canvas->translate(layer_rect_.x(), layer_rect_.y());
- if (playback_) {
- playback_->draw(canvas);
- } else if (callback) {
+ if (callback) {
// If we have a callback, we need to call |draw()|, |drawPicture()| doesn't
// take a callback. This is used by |AnalysisCanvas| to early out.
picture_->draw(canvas, callback);
@@ -371,12 +355,7 @@ int Picture::Raster(SkCanvas* canvas,
void Picture::Replay(SkCanvas* canvas) {
TRACE_EVENT_BEGIN0("cc", "Picture::Replay");
DCHECK(picture_);
-
- if (playback_) {
- playback_->draw(canvas);
- } else {
- picture_->draw(canvas);
- }
+ picture_->draw(canvas);
SkIRect bounds;
canvas->getClipDeviceBounds(&bounds);
TRACE_EVENT_END1("cc", "Picture::Replay",
@@ -385,21 +364,7 @@ void Picture::Replay(SkCanvas* canvas) {
scoped_ptr<base::Value> Picture::AsValue() const {
SkDynamicMemoryWStream stream;
-
- if (playback_) {
- // SkPlayback can't serialize itself, so re-record into an SkPicture.
- SkPictureRecorder recorder;
- skia::RefPtr<SkCanvas> canvas(skia::SharePtr(recorder.beginRecording(
- layer_rect_.width(),
- layer_rect_.height(),
- NULL))); // Default (no) bounding-box hierarchy is fastest.
- playback_->draw(canvas.get());
- skia::RefPtr<SkPicture> picture(skia::AdoptRef(recorder.endRecording()));
- picture->serialize(&stream, &EncodeBitmap);
- } else {
- // Serialize the picture.
- picture_->serialize(&stream, &EncodeBitmap);
- }
+ picture_->serialize(&stream, &EncodeBitmap);
// Encode the picture as base64.
scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698