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 GrShaderDataManager*, GrFragmentPro
cessor** fp) const { | 368 GrProcessorDataManager*, |
| 369 GrFragmentProcessor** fp) const { |
369 SkMatrix matrix; | 370 SkMatrix matrix; |
370 matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height()); | 371 matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height()); |
371 | 372 |
372 SkMatrix lmInverse; | 373 SkMatrix lmInverse; |
373 if (!this->getLocalMatrix().invert(&lmInverse)) { | 374 if (!this->getLocalMatrix().invert(&lmInverse)) { |
374 return false; | 375 return false; |
375 } | 376 } |
376 if (localMatrix) { | 377 if (localMatrix) { |
377 SkMatrix inv; | 378 SkMatrix inv; |
378 if (!localMatrix->invert(&inv)) { | 379 if (!localMatrix->invert(&inv)) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 } else { | 445 } else { |
445 *fp = GrSimpleTextureEffect::Create(texture, matrix, params); | 446 *fp = GrSimpleTextureEffect::Create(texture, matrix, params); |
446 } | 447 } |
447 | 448 |
448 return true; | 449 return true; |
449 } | 450 } |
450 | 451 |
451 #else | 452 #else |
452 | 453 |
453 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, | 454 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, |
454 const SkMatrix*, GrColor*, GrShader
DataManager*, | 455 const SkMatrix*, GrColor*, GrProces
sorDataManager*, |
455 GrFragmentProcessor**) const { | 456 GrFragmentProcessor**) const { |
456 SkDEBUGFAIL("Should not call in GPU-less build"); | 457 SkDEBUGFAIL("Should not call in GPU-less build"); |
457 return false; | 458 return false; |
458 } | 459 } |
459 | 460 |
460 #endif | 461 #endif |
OLD | NEW |