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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 2264433002: Revert of Fast path translate() in SkCanvas and SkLiteDL. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkLiteDL.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); 1437 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint);
1438 } 1438 }
1439 } 1439 }
1440 1440
1441 LOOPER_END 1441 LOOPER_END
1442 } 1442 }
1443 1443
1444 ///////////////////////////////////////////////////////////////////////////// 1444 /////////////////////////////////////////////////////////////////////////////
1445 1445
1446 void SkCanvas::translate(SkScalar dx, SkScalar dy) { 1446 void SkCanvas::translate(SkScalar dx, SkScalar dy) {
1447 this->checkForDeferredSave(); 1447 SkMatrix m;
1448 fDeviceCMDirty = true; 1448 m.setTranslate(dx, dy);
1449 fMCRec->fMatrix.preTranslate(dx,dy); 1449 this->concat(m);
1450
1451 // Translate shouldn't affect the is-scale-translateness of the matrix.
1452 SkASSERT(fIsScaleTranslate == fMCRec->fMatrix.isScaleTranslate());
1453
1454 this->didTranslate(dx,dy);
1455 } 1450 }
1456 1451
1457 void SkCanvas::scale(SkScalar sx, SkScalar sy) { 1452 void SkCanvas::scale(SkScalar sx, SkScalar sy) {
1458 SkMatrix m; 1453 SkMatrix m;
1459 m.setScale(sx, sy); 1454 m.setScale(sx, sy);
1460 this->concat(m); 1455 this->concat(m);
1461 } 1456 }
1462 1457
1463 void SkCanvas::rotate(SkScalar degrees) { 1458 void SkCanvas::rotate(SkScalar degrees) {
1464 SkMatrix m; 1459 SkMatrix m;
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after
3363 3358
3364 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3359 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3365 fCanvas->restoreToCount(fSaveCount); 3360 fCanvas->restoreToCount(fSaveCount);
3366 } 3361 }
3367 3362
3368 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3363 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3369 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3364 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3370 return this->makeSurface(info, props).release(); 3365 return this->makeSurface(info, props).release();
3371 } 3366 }
3372 #endif 3367 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkLiteDL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698