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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // better! | 90 // better! |
91 SkASSERT(copyParams.fFilter != GrTextureParams::kMipMap_FilterMode); | 91 SkASSERT(copyParams.fFilter != GrTextureParams::kMipMap_FilterMode); |
92 paint.addColorFragmentProcessor( | 92 paint.addColorFragmentProcessor( |
93 GrTextureDomainEffect::Create(inputTexture, SkMatrix::I(), domain, | 93 GrTextureDomainEffect::Create(inputTexture, SkMatrix::I(), domain, |
94 GrTextureDomain::kClamp_Mode, | 94 GrTextureDomain::kClamp_Mode, |
95 copyParams.fFilter))->unref(); | 95 copyParams.fFilter))->unref(); |
96 } else { | 96 } else { |
97 GrTextureParams params(SkShader::kClamp_TileMode, copyParams.fFilter); | 97 GrTextureParams params(SkShader::kClamp_TileMode, copyParams.fFilter); |
98 paint.addColorTextureProcessor(inputTexture, SkMatrix::I(), params); | 98 paint.addColorTextureProcessor(inputTexture, SkMatrix::I(), params); |
99 } | 99 } |
| 100 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
100 | 101 |
101 SkRect localRect; | 102 SkRect localRect; |
102 if (subset) { | 103 if (subset) { |
103 localRect = SkRect::Make(*subset); | 104 localRect = SkRect::Make(*subset); |
104 localRect.fLeft *= sx; | 105 localRect.fLeft *= sx; |
105 localRect.fTop *= sy; | 106 localRect.fTop *= sy; |
106 localRect.fRight *= sx; | 107 localRect.fRight *= sx; |
107 localRect.fBottom *= sy; | 108 localRect.fBottom *= sy; |
108 } else { | 109 } else { |
109 localRect = SkRect::MakeWH(1.f, 1.f); | 110 localRect = SkRect::MakeWH(1.f, 1.f); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 filterOrNullForBicubic); | 474 filterOrNullForBicubic); |
474 } | 475 } |
475 | 476 |
476 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
) { | 477 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
) { |
477 SkAutoTUnref<GrTexture> original(this->refOriginalTexture()); | 478 SkAutoTUnref<GrTexture> original(this->refOriginalTexture()); |
478 if (!original) { | 479 if (!original) { |
479 return nullptr; | 480 return nullptr; |
480 } | 481 } |
481 return copy_on_gpu(original, nullptr, copyParams); | 482 return copy_on_gpu(original, nullptr, copyParams); |
482 } | 483 } |
OLD | NEW |