| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 config = kSkia8888_GrPixelConfig; | 54 config = kSkia8888_GrPixelConfig; |
| 55 } else { | 55 } else { |
| 56 return nullptr; | 56 return nullptr; |
| 57 } | 57 } |
| 58 } else { | 58 } else { |
| 59 return nullptr; | 59 return nullptr; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 sk_sp<GrDrawContext> copyDC = context->newDrawContext(SkBackingFit::kExact,
copyParams.fWidth, | 63 sk_sp<GrDrawContext> copyDC = context->newDrawContext(SkBackingFit::kExact,
copyParams.fWidth, |
| 64 copyParams.fHeight, co
nfig); | 64 copyParams.fHeight, co
nfig, nullptr); |
| 65 if (!copyDC) { | 65 if (!copyDC) { |
| 66 return nullptr; | 66 return nullptr; |
| 67 } | 67 } |
| 68 | 68 |
| 69 GrPaint paint; | 69 GrPaint paint; |
| 70 paint.setGammaCorrect(true); | 70 paint.setGammaCorrect(true); |
| 71 | 71 |
| 72 SkScalar sx SK_INIT_TO_AVOID_WARNING; | 72 SkScalar sx SK_INIT_TO_AVOID_WARNING; |
| 73 SkScalar sy SK_INIT_TO_AVOID_WARNING; | 73 SkScalar sy SK_INIT_TO_AVOID_WARNING; |
| 74 if (subset) { | 74 if (subset) { |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 516 } |
| 517 | 517 |
| 518 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
, bool willBeMipped, | 518 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
, bool willBeMipped, |
| 519 SkSourceGammaTreatment gamma
Treatment) { | 519 SkSourceGammaTreatment gamma
Treatment) { |
| 520 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gamm
aTreatment)); | 520 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gamm
aTreatment)); |
| 521 if (!original) { | 521 if (!original) { |
| 522 return nullptr; | 522 return nullptr; |
| 523 } | 523 } |
| 524 return copy_on_gpu(original, nullptr, copyParams); | 524 return copy_on_gpu(original, nullptr, copyParams); |
| 525 } | 525 } |
| OLD | NEW |