| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 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 "SkBitmapProcShader.h" | 8 #include "SkBitmapProcShader.h" |
| 9 #include "SkBitmapProcState.h" | 9 #include "SkBitmapProcState.h" |
| 10 #include "SkBitmapProvider.h" | 10 #include "SkBitmapProvider.h" |
| 11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
| 12 #include "SkErrorInternals.h" | 12 #include "SkErrorInternals.h" |
| 13 #include "SkPixelRef.h" | 13 #include "SkPixelRef.h" |
| 14 #include "SkReadBuffer.h" | 14 #include "SkReadBuffer.h" |
| 15 #include "SkWriteBuffer.h" | 15 #include "SkWriteBuffer.h" |
| 16 | 16 |
| 17 #if SK_SUPPORT_GPU | 17 #if SK_SUPPORT_GPU |
| 18 #include "effects/GrBicubicEffect.h" | 18 #include "effects/GrBicubicEffect.h" |
| 19 #include "effects/GrExtractAlphaFragmentProcessor.h" | |
| 20 #include "effects/GrSimpleTextureEffect.h" | 19 #include "effects/GrSimpleTextureEffect.h" |
| 21 #endif | 20 #endif |
| 22 | 21 |
| 23 size_t SkBitmapProcShader::ContextSize() { | 22 size_t SkBitmapProcShader::ContextSize() { |
| 24 // The SkBitmapProcState is stored outside of the context object, with the c
ontext holding | 23 // The SkBitmapProcState is stored outside of the context object, with the c
ontext holding |
| 25 // a pointer to it. | 24 // a pointer to it. |
| 26 return sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState); | 25 return sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState); |
| 27 } | 26 } |
| 28 | 27 |
| 29 SkBitmapProcShader::SkBitmapProcShader(const SkBitmap& src, TileMode tmx, TileMo
de tmy, | 28 SkBitmapProcShader::SkBitmapProcShader(const SkBitmap& src, TileMode tmx, TileMo
de tmy, |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 SkAutoTUnref<GrFragmentProcessor> inner; | 403 SkAutoTUnref<GrFragmentProcessor> inner; |
| 405 if (doBicubic) { | 404 if (doBicubic) { |
| 406 inner.reset(GrBicubicEffect::Create(procDataManager, texture, matrix, tm
)); | 405 inner.reset(GrBicubicEffect::Create(procDataManager, texture, matrix, tm
)); |
| 407 } else { | 406 } else { |
| 408 inner.reset(GrSimpleTextureEffect::Create(procDataManager, texture, matr
ix, params)); | 407 inner.reset(GrSimpleTextureEffect::Create(procDataManager, texture, matr
ix, params)); |
| 409 } | 408 } |
| 410 | 409 |
| 411 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { | 410 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { |
| 412 return SkRef(inner.get()); | 411 return SkRef(inner.get()); |
| 413 } | 412 } |
| 414 return GrExtractAlphaFragmentProcessor::Create(inner); | 413 return MulFragmentProcesorOuputByInputAlpha(inner); |
| 415 } | 414 } |
| 416 | 415 |
| 417 #endif | 416 #endif |
| OLD | NEW |