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

Unified Diff: src/image/SkImage_Picture.cpp

Issue 233943002: remove picture-backed surfaces (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 8 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 | « src/image/SkImagePriv.h ('k') | src/image/SkSurface_Picture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Picture.cpp
diff --git a/src/image/SkImage_Picture.cpp b/src/image/SkImage_Picture.cpp
deleted file mode 100644
index 87221de27b555f700560c429c9110e52ae1bfd6e..0000000000000000000000000000000000000000
--- a/src/image/SkImage_Picture.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkImage_Base.h"
-#include "SkImagePriv.h"
-#include "SkPicture.h"
-
-class SkImage_Picture : public SkImage_Base {
-public:
- SkImage_Picture(SkPicture*);
- virtual ~SkImage_Picture();
-
- virtual void onDraw(SkCanvas*, SkScalar, SkScalar, const SkPaint*) SK_OVERRIDE;
- virtual void onDrawRectToRect(SkCanvas*, const SkRect*, const SkRect&, const SkPaint*) SK_OVERRIDE;
-
- SkPicture* getPicture() { return fPicture; }
-
-private:
- SkPicture* fPicture;
-
- typedef SkImage_Base INHERITED;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-
-SkImage_Picture::SkImage_Picture(SkPicture* pict) : INHERITED(pict->width(), pict->height()) {
- pict->endRecording();
- pict->ref();
- fPicture = pict;
-}
-
-SkImage_Picture::~SkImage_Picture() {
- fPicture->unref();
-}
-
-void SkImage_Picture::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
- const SkPaint* paint) {
- SkImagePrivDrawPicture(canvas, fPicture, x, y, paint);
-}
-
-void SkImage_Picture::onDrawRectToRect(SkCanvas* canvas, const SkRect* src, const SkRect& dst,
- const SkPaint* paint) {
- SkImagePrivDrawPicture(canvas, fPicture, src, dst, paint);
-}
-
-SkImage* SkNewImageFromPicture(const SkPicture* srcPicture) {
- /**
- * We want to snapshot the playback status of the picture, w/o affecting
- * its ability to continue recording (if needed).
- *
- * Optimally this will shared as much data/buffers as it can with
- * srcPicture, and srcPicture will perform a copy-on-write as needed if it
- * needs to mutate them later on.
- */
- SkAutoTUnref<SkPicture> playback(SkNEW_ARGS(SkPicture, (*srcPicture)));
-
- return SkNEW_ARGS(SkImage_Picture, (playback));
-}
-
-SkPicture* SkPictureImageGetPicture(SkImage* pictureImage) {
- return static_cast<SkImage_Picture*>(pictureImage)->getPicture();
-}
« no previous file with comments | « src/image/SkImagePriv.h ('k') | src/image/SkSurface_Picture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698