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" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 fRawBitmap = src; | 265 fRawBitmap = src; |
266 fTileModeX = (uint8_t)tmx; | 266 fTileModeX = (uint8_t)tmx; |
267 fTileModeY = (uint8_t)tmy; | 267 fTileModeY = (uint8_t)tmy; |
268 } | 268 } |
269 | 269 |
270 bool SkBitmapProcShader::onIsABitmap(SkBitmap* texture, SkMatrix* texM, TileMode
xy[]) const { | 270 bool SkBitmapProcShader::onIsABitmap(SkBitmap* texture, SkMatrix* texM, TileMode
xy[]) const { |
271 if (texture) { | 271 if (texture) { |
272 *texture = fRawBitmap; | 272 *texture = fRawBitmap; |
273 } | 273 } |
274 if (texM) { | 274 if (texM) { |
275 texM->reset(); | 275 *texM = this->getLocalMatrix(); |
276 } | 276 } |
277 if (xy) { | 277 if (xy) { |
278 xy[0] = (TileMode)fTileModeX; | 278 xy[0] = (TileMode)fTileModeX; |
279 xy[1] = (TileMode)fTileModeY; | 279 xy[1] = (TileMode)fTileModeY; |
280 } | 280 } |
281 return true; | 281 return true; |
282 } | 282 } |
283 | 283 |
284 sk_sp<SkFlattenable> SkBitmapProcShader::CreateProc(SkReadBuffer& buffer) { | 284 sk_sp<SkFlattenable> SkBitmapProcShader::CreateProc(SkReadBuffer& buffer) { |
285 SkMatrix lm; | 285 SkMatrix lm; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 inner = GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform),
matrix, params); | 466 inner = GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform),
matrix, params); |
467 } | 467 } |
468 | 468 |
469 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { | 469 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { |
470 return GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(inne
r)); | 470 return GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(inne
r)); |
471 } | 471 } |
472 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); | 472 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); |
473 } | 473 } |
474 | 474 |
475 #endif | 475 #endif |
OLD | NEW |