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

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

Issue 1014533004: SkPaint::FilterLevel -> SkFilterQuality (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « src/animator/SkDrawPaint.cpp ('k') | src/core/SkBitmapProcState.cpp » ('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 /* 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 (TileMode)fTileModeX, 390 (TileMode)fTileModeX,
391 (TileMode)fTileModeY, 391 (TileMode)fTileModeY,
392 }; 392 };
393 393
394 // Must set wrap and filter on the sampler before requesting a texture. In t wo places below 394 // Must set wrap and filter on the sampler before requesting a texture. In t wo places below
395 // we check the matrix scale factors to determine how to interpret the filte r quality setting. 395 // we check the matrix scale factors to determine how to interpret the filte r quality setting.
396 // This completely ignores the complexity of the drawVertices case where exp licit local coords 396 // This completely ignores the complexity of the drawVertices case where exp licit local coords
397 // are provided by the caller. 397 // are provided by the caller.
398 bool useBicubic = false; 398 bool useBicubic = false;
399 GrTextureParams::FilterMode textureFilterMode; 399 GrTextureParams::FilterMode textureFilterMode;
400 switch(paint.getFilterLevel()) { 400 switch(paint.getFilterQuality()) {
401 case SkPaint::kNone_FilterLevel: 401 case kNone_SkFilterQuality:
402 textureFilterMode = GrTextureParams::kNone_FilterMode; 402 textureFilterMode = GrTextureParams::kNone_FilterMode;
403 break; 403 break;
404 case SkPaint::kLow_FilterLevel: 404 case kLow_SkFilterQuality:
405 textureFilterMode = GrTextureParams::kBilerp_FilterMode; 405 textureFilterMode = GrTextureParams::kBilerp_FilterMode;
406 break; 406 break;
407 case SkPaint::kMedium_FilterLevel: { 407 case kMedium_SkFilterQuality: {
408 SkMatrix matrix; 408 SkMatrix matrix;
409 matrix.setConcat(viewM, this->getLocalMatrix()); 409 matrix.setConcat(viewM, this->getLocalMatrix());
410 if (matrix.getMinScale() < SK_Scalar1) { 410 if (matrix.getMinScale() < SK_Scalar1) {
411 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 411 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
412 } else { 412 } else {
413 // Don't trigger MIP level generation unnecessarily. 413 // Don't trigger MIP level generation unnecessarily.
414 textureFilterMode = GrTextureParams::kBilerp_FilterMode; 414 textureFilterMode = GrTextureParams::kBilerp_FilterMode;
415 } 415 }
416 break; 416 break;
417 } 417 }
418 case SkPaint::kHigh_FilterLevel: { 418 case kHigh_SkFilterQuality: {
419 SkMatrix matrix; 419 SkMatrix matrix;
420 matrix.setConcat(viewM, this->getLocalMatrix()); 420 matrix.setConcat(viewM, this->getLocalMatrix());
421 useBicubic = GrBicubicEffect::ShouldUseBicubic(matrix, &textureFilte rMode); 421 useBicubic = GrBicubicEffect::ShouldUseBicubic(matrix, &textureFilte rMode);
422 break; 422 break;
423 } 423 }
424 default: 424 default:
425 SkErrorInternals::SetError( kInvalidPaint_SkError, 425 SkErrorInternals::SetError( kInvalidPaint_SkError,
426 "Sorry, I don't understand the filtering " 426 "Sorry, I don't understand the filtering "
427 "mode you asked for. Falling back to " 427 "mode you asked for. Falling back to "
428 "MIPMaps."); 428 "MIPMaps.");
(...skipping 26 matching lines...) Expand all
455 #else 455 #else
456 456
457 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S kMatrix&, 457 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S kMatrix&,
458 const SkMatrix*, GrColor*, 458 const SkMatrix*, GrColor*,
459 GrFragmentProcessor**) const { 459 GrFragmentProcessor**) const {
460 SkDEBUGFAIL("Should not call in GPU-less build"); 460 SkDEBUGFAIL("Should not call in GPU-less build");
461 return false; 461 return false;
462 } 462 }
463 463
464 #endif 464 #endif
OLDNEW
« no previous file with comments | « src/animator/SkDrawPaint.cpp ('k') | src/core/SkBitmapProcState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698