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

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

Issue 295713002: Rename SkMatrix::get(Min|Max)Stretch to get(Min|Max)Scale (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rename Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkMatrix.h ('k') | src/core/SkMatrix.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 #if SK_SUPPORT_GPU 379 #if SK_SUPPORT_GPU
380 380
381 #include "GrTextureAccess.h" 381 #include "GrTextureAccess.h"
382 #include "effects/GrSimpleTextureEffect.h" 382 #include "effects/GrSimpleTextureEffect.h"
383 #include "SkGr.h" 383 #include "SkGr.h"
384 384
385 // Note that this will return -1 if either matrix is perspective. 385 // Note that this will return -1 if either matrix is perspective.
386 static SkScalar get_combined_min_stretch(const SkMatrix& viewMatrix, const SkMat rix& localMatrix) { 386 static SkScalar get_combined_min_stretch(const SkMatrix& viewMatrix, const SkMat rix& localMatrix) {
387 if (localMatrix.isIdentity()) { 387 if (localMatrix.isIdentity()) {
388 return viewMatrix.getMinStretch(); 388 return viewMatrix.getMinScale();
389 } else { 389 } else {
390 SkMatrix combined; 390 SkMatrix combined;
391 combined.setConcat(viewMatrix, localMatrix); 391 combined.setConcat(viewMatrix, localMatrix);
392 return combined.getMinStretch(); 392 return combined.getMinScale();
393 } 393 }
394 } 394 }
395 395
396 GrEffectRef* SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& paint, 396 GrEffectRef* SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& paint,
397 const SkMatrix* localMatrix) const { 397 const SkMatrix* localMatrix) const {
398 SkMatrix matrix; 398 SkMatrix matrix;
399 matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height()); 399 matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height());
400 400
401 SkMatrix lmInverse; 401 SkMatrix lmInverse;
402 if (!this->getLocalMatrix().invert(&lmInverse)) { 402 if (!this->getLocalMatrix().invert(&lmInverse)) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 GrEffectRef* effect = NULL; 472 GrEffectRef* effect = NULL;
473 if (paintFilterLevel == SkPaint::kHigh_FilterLevel) { 473 if (paintFilterLevel == SkPaint::kHigh_FilterLevel) {
474 effect = GrBicubicEffect::Create(texture, matrix, tm); 474 effect = GrBicubicEffect::Create(texture, matrix, tm);
475 } else { 475 } else {
476 effect = GrSimpleTextureEffect::Create(texture, matrix, params); 476 effect = GrSimpleTextureEffect::Create(texture, matrix, params);
477 } 477 }
478 GrUnlockAndUnrefCachedBitmapTexture(texture); 478 GrUnlockAndUnrefCachedBitmapTexture(texture);
479 return effect; 479 return effect;
480 } 480 }
481 #endif 481 #endif
OLDNEW
« no previous file with comments | « include/core/SkMatrix.h ('k') | src/core/SkMatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698