Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: src/core/SkBitmapProcShader.cpp

Issue 2197323002: implement isABitmap for imageshader, return localmatrix for bitmap's impl (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add isAImage api Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkShader.h ('k') | src/image/SkImageShader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « include/core/SkShader.h ('k') | src/image/SkImageShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698