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

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

Issue 1632633002: Delete 2 legacy flags (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « src/core/SkBitmapController.cpp ('k') | src/core/SkMipMap.cpp » ('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 2006 The Android Open Source Project 2 * Copyright 2006 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 "SkMatrix.h" 8 #include "SkMatrix.h"
9 #include "SkFloatBits.h" 9 #include "SkFloatBits.h"
10 #include "SkRSXform.h" 10 #include "SkRSXform.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // so we can get away with these blind multiplies. 373 // so we can get away with these blind multiplies.
374 374
375 fMat[kMScaleX] *= sx; 375 fMat[kMScaleX] *= sx;
376 fMat[kMSkewY] *= sx; 376 fMat[kMSkewY] *= sx;
377 fMat[kMPersp0] *= sx; 377 fMat[kMPersp0] *= sx;
378 378
379 fMat[kMSkewX] *= sy; 379 fMat[kMSkewX] *= sy;
380 fMat[kMScaleY] *= sy; 380 fMat[kMScaleY] *= sy;
381 fMat[kMPersp1] *= sy; 381 fMat[kMPersp1] *= sy;
382 382
383 #ifndef SK_SUPPORT_LEGACY_PRESCALE_SEMANTICS
384 // Attempt to simplify our type when applying an inverse scale. 383 // Attempt to simplify our type when applying an inverse scale.
385 // TODO: The persp/affine preconditions are in place to keep the mask consis tent with 384 // TODO: The persp/affine preconditions are in place to keep the mask consis tent with
386 // what computeTypeMask() would produce (persp/skew always implies kSc ale). 385 // what computeTypeMask() would produce (persp/skew always implies kSc ale).
387 // We should investigate whether these flag dependencies are truly nee ded. 386 // We should investigate whether these flag dependencies are truly nee ded.
388 if (fMat[kMScaleX] == 1 && fMat[kMScaleY] == 1 387 if (fMat[kMScaleX] == 1 && fMat[kMScaleY] == 1
389 && !(fTypeMask & (kPerspective_Mask | kAffine_Mask))) { 388 && !(fTypeMask & (kPerspective_Mask | kAffine_Mask))) {
390 this->clearTypeMask(kScale_Mask); 389 this->clearTypeMask(kScale_Mask);
391 } else { 390 } else {
392 this->orTypeMask(kScale_Mask); 391 this->orTypeMask(kScale_Mask);
393 } 392 }
394 #else
395 this->orTypeMask(kScale_Mask);
396 #endif
397 } 393 }
398 394
399 void SkMatrix::postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) { 395 void SkMatrix::postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) {
400 if (1 == sx && 1 == sy) { 396 if (1 == sx && 1 == sy) {
401 return; 397 return;
402 } 398 }
403 SkMatrix m; 399 SkMatrix m;
404 m.setScale(sx, sy, px, py); 400 m.setScale(sx, sy, px, py);
405 this->postConcat(m); 401 this->postConcat(m);
406 } 402 }
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 const SkScalar m11 = m00; 1794 const SkScalar m11 = m00;
1799 const SkScalar m12 = fTy; 1795 const SkScalar m12 = fTy;
1800 1796
1801 quad[0].set(m02, m12); 1797 quad[0].set(m02, m12);
1802 quad[1].set(m00 * width + m02, m10 * width + m12); 1798 quad[1].set(m00 * width + m02, m10 * width + m12);
1803 quad[2].set(m00 * width + m01 * height + m02, m10 * width + m11 * height + m 12); 1799 quad[2].set(m00 * width + m01 * height + m02, m10 * width + m11 * height + m 12);
1804 quad[3].set(m01 * height + m02, m11 * height + m12); 1800 quad[3].set(m01 * height + m02, m11 * height + m12);
1805 #endif 1801 #endif
1806 } 1802 }
1807 1803
OLDNEW
« no previous file with comments | « src/core/SkBitmapController.cpp ('k') | src/core/SkMipMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698