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

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

Issue 1404433002: Remove image usage type enum. Use GrTextureParams instead. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no gpu build Created 5 years, 2 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/gpu/SkGr.h ('k') | src/core/SkImageCacherator.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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 // Must set wrap and filter on the sampler before requesting a texture. In t wo places below 386 // Must set wrap and filter on the sampler before requesting a texture. In t wo places below
387 // we check the matrix scale factors to determine how to interpret the filte r quality setting. 387 // we check the matrix scale factors to determine how to interpret the filte r quality setting.
388 // This completely ignores the complexity of the drawVertices case where exp licit local coords 388 // This completely ignores the complexity of the drawVertices case where exp licit local coords
389 // are provided by the caller. 389 // are provided by the caller.
390 bool doBicubic; 390 bool doBicubic;
391 GrTextureParams::FilterMode textureFilterMode = 391 GrTextureParams::FilterMode textureFilterMode =
392 GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocal Matrix(), 392 GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocal Matrix(),
393 &doBicubic); 393 &doBicubic);
394 GrTextureParams params(tm, textureFilterMode); 394 GrTextureParams params(tm, textureFilterMode);
395 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fRawBitmap , &params)); 395 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fRawBitmap , params));
396 396
397 if (!texture) { 397 if (!texture) {
398 SkErrorInternals::SetError( kInternalError_SkError, 398 SkErrorInternals::SetError( kInternalError_SkError,
399 "Couldn't convert bitmap to texture."); 399 "Couldn't convert bitmap to texture.");
400 return nullptr; 400 return nullptr;
401 } 401 }
402 402
403 SkAutoTUnref<GrFragmentProcessor> inner; 403 SkAutoTUnref<GrFragmentProcessor> inner;
404 if (doBicubic) { 404 if (doBicubic) {
405 inner.reset(GrBicubicEffect::Create(texture, matrix, tm)); 405 inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
406 } else { 406 } else {
407 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params)); 407 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params));
408 } 408 }
409 409
410 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { 410 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) {
411 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner); 411 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner);
412 } 412 }
413 return GrFragmentProcessor::MulOutputByInputAlpha(inner); 413 return GrFragmentProcessor::MulOutputByInputAlpha(inner);
414 } 414 }
415 415
416 #endif 416 #endif
OLDNEW
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/core/SkImageCacherator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698