| 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" |
| 11 #include "GrContext.h" | 11 #include "GrContext.h" |
| 12 #include "GrDrawContext.h" | 12 #include "GrDrawContext.h" |
| 13 #include "GrGpu.h" | 13 #include "GrGpu.h" |
| 14 #include "GrGpuResourcePriv.h" | 14 #include "GrGpuResourcePriv.h" |
| 15 #include "GrResourceKey.h" | 15 #include "GrResourceKey.h" |
| 16 #include "GrTexture.h" | 16 #include "GrTexture.h" |
| 17 #include "GrTextureParams.h" | 17 #include "GrTextureParams.h" |
| 18 #include "GrTextureProvider.h" | 18 #include "GrTextureProvider.h" |
| 19 #include "SkCanvas.h" | 19 #include "SkCanvas.h" |
| 20 #include "SkGr.h" | 20 #include "SkGr.h" |
| 21 #include "SkGrPriv.h" | 21 #include "SkGrPriv.h" |
| 22 #include "effects/GrBicubicEffect.h" | 22 #include "effects/GrBicubicEffect.h" |
| 23 #include "effects/GrSimpleTextureEffect.h" |
| 23 #include "effects/GrTextureDomain.h" | 24 #include "effects/GrTextureDomain.h" |
| 24 | 25 |
| 25 typedef GrTextureProducer::CopyParams CopyParams; | 26 typedef GrTextureProducer::CopyParams CopyParams; |
| 26 | 27 |
| 27 ////////////////////////////////////////////////////////////////////////////// | 28 ////////////////////////////////////////////////////////////////////////////// |
| 28 | 29 |
| 29 static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset, | 30 static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset, |
| 30 const CopyParams& copyParams) { | 31 const CopyParams& copyParams) { |
| 31 SkASSERT(!subset || !subset->isEmpty()); | 32 SkASSERT(!subset || !subset->isEmpty()); |
| 32 GrContext* context = inputTexture->getContext(); | 33 GrContext* context = inputTexture->getContext(); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 517 } |
| 517 | 518 |
| 518 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
, bool willBeMipped, | 519 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
, bool willBeMipped, |
| 519 SkSourceGammaTreatment gamma
Treatment) { | 520 SkSourceGammaTreatment gamma
Treatment) { |
| 520 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gamm
aTreatment)); | 521 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gamm
aTreatment)); |
| 521 if (!original) { | 522 if (!original) { |
| 522 return nullptr; | 523 return nullptr; |
| 523 } | 524 } |
| 524 return copy_on_gpu(original, nullptr, copyParams); | 525 return copy_on_gpu(original, nullptr, copyParams); |
| 525 } | 526 } |
| OLD | NEW |