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

Unified Diff: src/core/SkPicture.cpp

Issue 381133002: Remove SkPicture copy constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removed unused "copy" method Created 6 years, 5 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 | « samplecode/SampleApp.cpp ('k') | src/core/SkPictureData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index 9261664717eeaf72cf170a1356b630cf79d8fc6e..b96caf908c95dca0503dab5c5ea34df15ff7e15a 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -109,24 +109,6 @@ const char* DrawTypeToString(DrawType drawType) {
}
#endif
-#ifdef SK_DEBUG_VALIDATE
-static void validateMatrix(const SkMatrix* matrix) {
- SkScalar scaleX = matrix->getScaleX();
- SkScalar scaleY = matrix->getScaleY();
- SkScalar skewX = matrix->getSkewX();
- SkScalar skewY = matrix->getSkewY();
- SkScalar perspX = matrix->getPerspX();
- SkScalar perspY = matrix->getPerspY();
- if (scaleX != 0 && skewX != 0)
- SkDebugf("scaleX != 0 && skewX != 0\n");
- SkASSERT(scaleX == 0 || skewX == 0);
- SkASSERT(scaleY == 0 || skewY == 0);
- SkASSERT(perspX == 0);
- SkASSERT(perspY == 0);
-}
-#endif
-
-
///////////////////////////////////////////////////////////////////////////////
// fRecord OK
@@ -151,14 +133,6 @@ SkPicture::SkPicture(int width, int height,
fData.reset(SkNEW_ARGS(SkPictureData, (record, info, deepCopyOps)));
}
-// The simplest / safest way to copy an SkRecord is to replay it into a new one.
-static SkRecord* copy(const SkRecord& src, int width, int height) {
- SkRecord* dst = SkNEW(SkRecord);
- SkRecorder recorder(dst, width, height);
- SkRecordDraw(src, &recorder);
- return dst;
-}
-
// Create an SkPictureData-backed SkPicture from an SkRecord.
// This for compatibility with serialization code only. This is not cheap.
static SkPicture* backport(const SkRecord& src, int width, int height) {
@@ -168,24 +142,6 @@ static SkPicture* backport(const SkRecord& src, int width, int height) {
}
// fRecord OK
-SkPicture::SkPicture(const SkPicture& src) : INHERITED() {
- this->needsNewGenID();
- fWidth = src.fWidth;
- fHeight = src.fHeight;
- fRecordWillPlayBackBitmaps = src.fRecordWillPlayBackBitmaps;
-
- if (NULL != src.fData.get()) {
- fData.reset(SkNEW_ARGS(SkPictureData, (*src.fData)));
- fUniqueID = src.uniqueID(); // need to call method to ensure != 0
- }
-
- if (NULL != src.fRecord.get()) {
- fRecord.reset(copy(*src.fRecord, fWidth, fHeight));
- fUniqueID = src.uniqueID(); // need to call method to ensure != 0
- }
-}
-
-// fRecord OK
SkPicture::~SkPicture() {}
#ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | src/core/SkPictureData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698