| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 #if SK_SUPPORT_GPU | 359 #if SK_SUPPORT_GPU |
| 360 | 360 |
| 361 #include "GrTextureAccess.h" | 361 #include "GrTextureAccess.h" |
| 362 #include "effects/GrSimpleTextureEffect.h" | 362 #include "effects/GrSimpleTextureEffect.h" |
| 363 #include "SkGr.h" | 363 #include "SkGr.h" |
| 364 | 364 |
| 365 bool SkBitmapProcShader::asFragmentProcessor(GrContext* context, const SkPaint&
paint, | 365 bool SkBitmapProcShader::asFragmentProcessor(GrContext* context, const SkPaint&
paint, |
| 366 const SkMatrix& viewM, | 366 const SkMatrix& viewM, |
| 367 const SkMatrix* localMatrix, GrColo
r* paintColor, | 367 const SkMatrix* localMatrix, GrColo
r* paintColor, |
| 368 GrFragmentProcessor** fp) const { | 368 GrShaderDataManager*, GrFragmentPro
cessor** fp) const { |
| 369 SkMatrix matrix; | 369 SkMatrix matrix; |
| 370 matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height()); | 370 matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height()); |
| 371 | 371 |
| 372 SkMatrix lmInverse; | 372 SkMatrix lmInverse; |
| 373 if (!this->getLocalMatrix().invert(&lmInverse)) { | 373 if (!this->getLocalMatrix().invert(&lmInverse)) { |
| 374 return false; | 374 return false; |
| 375 } | 375 } |
| 376 if (localMatrix) { | 376 if (localMatrix) { |
| 377 SkMatrix inv; | 377 SkMatrix inv; |
| 378 if (!localMatrix->invert(&inv)) { | 378 if (!localMatrix->invert(&inv)) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 } else { | 444 } else { |
| 445 *fp = GrSimpleTextureEffect::Create(texture, matrix, params); | 445 *fp = GrSimpleTextureEffect::Create(texture, matrix, params); |
| 446 } | 446 } |
| 447 | 447 |
| 448 return true; | 448 return true; |
| 449 } | 449 } |
| 450 | 450 |
| 451 #else | 451 #else |
| 452 | 452 |
| 453 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, | 453 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, |
| 454 const SkMatrix*, GrColor*, | 454 const SkMatrix*, GrColor*, GrShader
DataManager*, |
| 455 GrFragmentProcessor**) const { | 455 GrFragmentProcessor**) const { |
| 456 SkDEBUGFAIL("Should not call in GPU-less build"); | 456 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 457 return false; | 457 return false; |
| 458 } | 458 } |
| 459 | 459 |
| 460 #endif | 460 #endif |
| OLD | NEW |