| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |