OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrTextureParamsAdjuster.h" | 8 #include "GrTextureParamsAdjuster.h" |
9 | 9 |
10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // better! | 65 // better! |
66 SkASSERT(copyParams.fFilter != GrTextureParams::kMipMap_FilterMode); | 66 SkASSERT(copyParams.fFilter != GrTextureParams::kMipMap_FilterMode); |
67 paint.addColorFragmentProcessor( | 67 paint.addColorFragmentProcessor( |
68 GrTextureDomainEffect::Make(inputTexture, nullptr, SkMatrix::I(), do
main, | 68 GrTextureDomainEffect::Make(inputTexture, nullptr, SkMatrix::I(), do
main, |
69 GrTextureDomain::kClamp_Mode, | 69 GrTextureDomain::kClamp_Mode, |
70 copyParams.fFilter)); | 70 copyParams.fFilter)); |
71 } else { | 71 } else { |
72 GrTextureParams params(SkShader::kClamp_TileMode, copyParams.fFilter); | 72 GrTextureParams params(SkShader::kClamp_TileMode, copyParams.fFilter); |
73 paint.addColorTextureProcessor(inputTexture, nullptr, SkMatrix::I(), par
ams); | 73 paint.addColorTextureProcessor(inputTexture, nullptr, SkMatrix::I(), par
ams); |
74 } | 74 } |
75 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 75 paint.setPorterDuffXPFactory(SkBlendMode::kSrc); |
76 | 76 |
77 SkRect localRect; | 77 SkRect localRect; |
78 if (subset) { | 78 if (subset) { |
79 localRect = SkRect::Make(*subset); | 79 localRect = SkRect::Make(*subset); |
80 localRect.fLeft *= sx; | 80 localRect.fLeft *= sx; |
81 localRect.fTop *= sy; | 81 localRect.fTop *= sy; |
82 localRect.fRight *= sx; | 82 localRect.fRight *= sx; |
83 localRect.fBottom *= sy; | 83 localRect.fBottom *= sy; |
84 } else { | 84 } else { |
85 localRect = SkRect::MakeWH(1.f, 1.f); | 85 localRect = SkRect::MakeWH(1.f, 1.f); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 } | 513 } |
514 | 514 |
515 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
, bool willBeMipped, | 515 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
, bool willBeMipped, |
516 SkSourceGammaTreatment gamma
Treatment) { | 516 SkSourceGammaTreatment gamma
Treatment) { |
517 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gamm
aTreatment)); | 517 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gamm
aTreatment)); |
518 if (!original) { | 518 if (!original) { |
519 return nullptr; | 519 return nullptr; |
520 } | 520 } |
521 return copy_on_gpu(original, nullptr, copyParams); | 521 return copy_on_gpu(original, nullptr, copyParams); |
522 } | 522 } |
OLD | NEW |