Skip to content

Commit f7cce2b

Browse files
reed-at-googleSkia Commit-Bot
authored andcommitted
Remove dead code (from old flags)
"SK_SUPPORT_LEGACY_CANVASMATRIX33", "SK_SUPPORT_LEGACY_MATRIX_FACTORIES", "SK_SUPPORT_LEGACY_SCALEPIXELS_PARAM", Change-Id: I6e20ba7c553317ce0c2c0c3a6d6706a3555dd51c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343112 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
1 parent 27b1dc5 commit f7cce2b

File tree

17 files changed

+0
-203
lines changed

17 files changed

+0
-203
lines changed

include/core/SkCanvas.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,10 +2507,6 @@ class SK_API SkCanvas {
25072507
virtual void onMarkCTM(const char*) {}
25082508
virtual void didConcat44(const SkM44&) {}
25092509
virtual void didSetM44(const SkM44&) {}
2510-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
2511-
virtual void didConcat(const SkMatrix& ) {}
2512-
virtual void didSetMatrix(const SkMatrix& ) {}
2513-
#endif
25142510
virtual void didTranslate(SkScalar, SkScalar) {}
25152511
virtual void didScale(SkScalar, SkScalar) {}
25162512

include/core/SkImage.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -665,13 +665,6 @@ class SK_API SkImage : public SkRefCnt {
665665
}
666666
#endif
667667

668-
#ifdef SK_SUPPORT_LEGACY_SCALEPIXELS_PARAM
669-
sk_sp<SkShader> makeShader(SkTileMode tmx, SkTileMode tmy, const SkMatrix* localMatrix,
670-
SkFilterQuality fq) const {
671-
return this->makeShader(tmx, tmy, SkSamplingOptions(fq), localMatrix);
672-
}
673-
#endif
674-
675668
/** Copies SkImage pixel address, row bytes, and SkImageInfo to pixmap, if address
676669
is available, and returns true. If pixel address is not available, return
677670
false and leave pixmap unchanged.
@@ -966,13 +959,6 @@ class SK_API SkImage : public SkRefCnt {
966959
bool scalePixels(const SkPixmap& dst, const SkSamplingOptions&,
967960
CachingHint cachingHint = kAllow_CachingHint) const;
968961

969-
#ifdef SK_SUPPORT_LEGACY_SCALEPIXELS_PARAM
970-
bool scalePixels(const SkPixmap& dst, SkFilterQuality fq,
971-
CachingHint cachingHint = kAllow_CachingHint) const {
972-
return this->scalePixels(dst, SkSamplingOptions(fq), cachingHint);
973-
}
974-
#endif
975-
976962
/** Encodes SkImage pixels, returning result as SkData.
977963
978964
Returns nullptr if encoding fails, or if encodedImageFormat is not supported.

include/core/SkMatrix.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,6 @@ class SK_API SkMatrix {
106106
return RotateDeg(SkRadiansToDegrees(rad));
107107
}
108108

109-
#ifdef SK_SUPPORT_LEGACY_MATRIX_FACTORIES
110-
// DEPRECATED
111-
static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkScalar dx, SkScalar dy) {
112-
return Translate(dx, dy);
113-
}
114-
static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar sx, SkScalar sy) {
115-
return Scale(sx, sy);
116-
}
117-
static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar scale) {
118-
return Scale(scale, scale);
119-
}
120-
static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkVector t) { return MakeTrans(t.x(), t.y()); }
121-
static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkIVector t) { return MakeTrans(t.x(), t.y()); }
122-
// end DEPRECATED
123-
#endif
124-
125109
/** Sets SkMatrix to:
126110
127111
| scaleX skewX transX |

include/core/SkPixmap.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,6 @@ class SK_API SkPixmap {
662662
*/
663663
bool scalePixels(const SkPixmap& dst, const SkSamplingOptions&) const;
664664

665-
#ifdef SK_SUPPORT_LEGACY_SCALEPIXELS_PARAM
666-
bool scalePixels(const SkPixmap& dst, SkFilterQuality fq) const;
667-
#endif
668-
669665
/** Writes color to pixels bounded by subset; returns true on success.
670666
Returns false if colorType() is kUnknown_SkColorType, or if subset does
671667
not intersect bounds().

include/utils/SkNWayCanvas.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class SK_API SkNWayCanvas : public SkCanvasVirtualEnforcer<SkNoDrawCanvas> {
3333
void onMarkCTM(const char*) override;
3434
void didConcat44(const SkM44&) override;
3535
void didSetM44(const SkM44&) override;
36-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
37-
void didConcat(const SkMatrix&) override;
38-
void didSetMatrix(const SkMatrix&) override;
39-
#endif
4036
void didScale(SkScalar, SkScalar) override;
4137
void didTranslate(SkScalar, SkScalar) override;
4238

src/core/SkCanvas.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,19 +1374,7 @@ void SkCanvas::concat(const SkMatrix& matrix) {
13741374
if (matrix.isIdentity()) {
13751375
return;
13761376
}
1377-
1378-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
1379-
this->checkForDeferredSave();
1380-
fMCRec->fMatrix.preConcat(matrix);
1381-
1382-
fIsScaleTranslate = SkMatrixPriv::IsScaleTranslateAsM33(fMCRec->fMatrix);
1383-
1384-
TOP_DEVICE(setGlobalCTM(fMCRec->fMatrix));
1385-
1386-
this->didConcat(matrix);
1387-
#else
13881377
this->concat(SkM44(matrix));
1389-
#endif
13901378
}
13911379

13921380
void SkCanvas::internalConcat44(const SkM44& m) {
@@ -1413,13 +1401,7 @@ void SkCanvas::internalSetMatrix(const SkM44& m) {
14131401
}
14141402

14151403
void SkCanvas::setMatrix(const SkMatrix& matrix) {
1416-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
1417-
this->checkForDeferredSave();
1418-
this->internalSetMatrix(SkM44(matrix));
1419-
this->didSetMatrix(matrix);
1420-
#else
14211404
this->setMatrix(SkM44(matrix));
1422-
#endif
14231405
}
14241406

14251407
void SkCanvas::setMatrix(const SkM44& m) {
@@ -1429,11 +1411,7 @@ void SkCanvas::setMatrix(const SkM44& m) {
14291411
}
14301412

14311413
void SkCanvas::resetMatrix() {
1432-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
1433-
this->setMatrix(SkMatrix::I());
1434-
#else
14351414
this->setMatrix(SkM44());
1436-
#endif
14371415
}
14381416

14391417
void SkCanvas::markCTM(const char* name) {

src/core/SkPictureRecord.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -237,47 +237,13 @@ void SkPictureRecord::didSetM44(const SkM44& m) {
237237
}
238238

239239
void SkPictureRecord::didScale(SkScalar x, SkScalar y) {
240-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
241-
this->didConcat(SkMatrix::Scale(x, y));
242-
#else
243240
this->didConcat44(SkM44::Scale(x, y));
244-
#endif
245241
}
246242

247243
void SkPictureRecord::didTranslate(SkScalar x, SkScalar y) {
248-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
249-
this->didConcat(SkMatrix::Translate(x, y));
250-
#else
251244
this->didConcat44(SkM44::Translate(x, y));
252-
#endif
253245
}
254246

255-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
256-
void SkPictureRecord::didConcat(const SkMatrix& matrix) {
257-
switch (matrix.getType()) {
258-
case SkMatrix::kTranslate_Mask:
259-
this->recordTranslate(matrix);
260-
break;
261-
case SkMatrix::kScale_Mask:
262-
this->recordScale(matrix);
263-
break;
264-
default:
265-
this->recordConcat(matrix);
266-
break;
267-
}
268-
this->INHERITED::didConcat(matrix);
269-
}
270-
void SkPictureRecord::didSetMatrix(const SkMatrix& matrix) {
271-
this->validate(fWriter.bytesWritten(), 0);
272-
// op + matrix
273-
size_t size = kUInt32Size + SkMatrixPriv::WriteToMemory(matrix, nullptr);
274-
size_t initialOffset = this->addDraw(SET_MATRIX, &size);
275-
this->addMatrix(matrix);
276-
this->validate(initialOffset, size);
277-
this->INHERITED::didSetMatrix(matrix);
278-
}
279-
#endif
280-
281247
void SkPictureRecord::recordConcat(const SkMatrix& matrix) {
282248
this->validate(fWriter.bytesWritten(), 0);
283249
// op + matrix

src/core/SkPictureRecord.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ class SkPictureRecord : public SkCanvasVirtualEnforcer<SkCanvas> {
165165
void onMarkCTM(const char*) override;
166166
void didConcat44(const SkM44&) override;
167167
void didSetM44(const SkM44&) override;
168-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
169-
void didConcat(const SkMatrix&) override;
170-
void didSetMatrix(const SkMatrix&) override;
171-
#endif
172168
void didScale(SkScalar, SkScalar) override;
173169
void didTranslate(SkScalar, SkScalar) override;
174170

src/core/SkPixmap.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,6 @@ bool SkPixmap::scalePixels(const SkPixmap& actualDst, const SkSamplingOptions& s
259259
return true;
260260
}
261261

262-
#ifdef SK_SUPPORT_LEGACY_SCALEPIXELS_PARAM
263-
bool SkPixmap::scalePixels(const SkPixmap& dst, SkFilterQuality fq) const {
264-
return this->scalePixels(dst, SkSamplingOptions(fq));
265-
}
266-
#endif
267-
268262
//////////////////////////////////////////////////////////////////////////////////////////////////
269263

270264
SkColor SkPixmap::getColor(int x, int y) const {

src/core/SkRecorder.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,6 @@ void SkRecorder::didSetM44(const SkM44& m) {
338338
this->append<SkRecords::SetM44>(m);
339339
}
340340

341-
#ifdef SK_SUPPORT_LEGACY_CANVASMATRIX33
342-
void SkRecorder::didConcat(const SkMatrix& matrix) {
343-
this->append<SkRecords::Concat>(matrix);
344-
}
345-
346-
void SkRecorder::didSetMatrix(const SkMatrix& matrix) {
347-
this->append<SkRecords::SetMatrix>(matrix);
348-
}
349-
#endif
350-
351341
void SkRecorder::didScale(SkScalar sx, SkScalar sy) {
352342
this->append<SkRecords::Scale>(sx, sy);
353343
}

0 commit comments

Comments
 (0)