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

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

Issue 2331943002: check for identity in translate (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | 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 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); 1450 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint);
1451 } 1451 }
1452 } 1452 }
1453 1453
1454 LOOPER_END 1454 LOOPER_END
1455 } 1455 }
1456 1456
1457 ///////////////////////////////////////////////////////////////////////////// 1457 /////////////////////////////////////////////////////////////////////////////
1458 1458
1459 void SkCanvas::translate(SkScalar dx, SkScalar dy) { 1459 void SkCanvas::translate(SkScalar dx, SkScalar dy) {
1460 this->checkForDeferredSave(); 1460 if (dx || dy) {
1461 fDeviceCMDirty = true; 1461 this->checkForDeferredSave();
1462 fMCRec->fMatrix.preTranslate(dx,dy); 1462 fDeviceCMDirty = true;
1463 fMCRec->fMatrix.preTranslate(dx,dy);
1463 1464
1464 // Translate shouldn't affect the is-scale-translateness of the matrix. 1465 // Translate shouldn't affect the is-scale-translateness of the matrix.
1465 SkASSERT(fIsScaleTranslate == fMCRec->fMatrix.isScaleTranslate()); 1466 SkASSERT(fIsScaleTranslate == fMCRec->fMatrix.isScaleTranslate());
1466 1467
1467 this->didTranslate(dx,dy); 1468 this->didTranslate(dx,dy);
1469 }
1468 } 1470 }
1469 1471
1470 void SkCanvas::scale(SkScalar sx, SkScalar sy) { 1472 void SkCanvas::scale(SkScalar sx, SkScalar sy) {
1471 SkMatrix m; 1473 SkMatrix m;
1472 m.setScale(sx, sy); 1474 m.setScale(sx, sy);
1473 this->concat(m); 1475 this->concat(m);
1474 } 1476 }
1475 1477
1476 void SkCanvas::rotate(SkScalar degrees) { 1478 void SkCanvas::rotate(SkScalar degrees) {
1477 SkMatrix m; 1479 SkMatrix m;
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after
3502 3504
3503 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3505 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3504 fCanvas->restoreToCount(fSaveCount); 3506 fCanvas->restoreToCount(fSaveCount);
3505 } 3507 }
3506 3508
3507 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3509 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3508 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3510 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3509 return this->makeSurface(info, props).release(); 3511 return this->makeSurface(info, props).release();
3510 } 3512 }
3511 #endif 3513 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698