| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 if (subset) { | 105 if (subset) { |
| 106 localRect = SkRect::Make(*subset); | 106 localRect = SkRect::Make(*subset); |
| 107 localRect.fLeft *= sx; | 107 localRect.fLeft *= sx; |
| 108 localRect.fTop *= sy; | 108 localRect.fTop *= sy; |
| 109 localRect.fRight *= sx; | 109 localRect.fRight *= sx; |
| 110 localRect.fBottom *= sy; | 110 localRect.fBottom *= sy; |
| 111 } else { | 111 } else { |
| 112 localRect = SkRect::MakeWH(1.f, 1.f); | 112 localRect = SkRect::MakeWH(1.f, 1.f); |
| 113 } | 113 } |
| 114 | 114 |
| 115 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(copy->asRenderT
arget())); | 115 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(copy->asRend
erTarget()))); |
| 116 if (!drawContext) { | 116 if (!drawContext) { |
| 117 return nullptr; | 117 return nullptr; |
| 118 } | 118 } |
| 119 | 119 |
| 120 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(
rtDesc.fHeight)); | 120 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(
rtDesc.fHeight)); |
| 121 drawContext->fillRectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), dstRec
t, localRect); | 121 drawContext->fillRectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), dstRec
t, localRect); |
| 122 return copy.release(); | 122 return copy.release(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, | 125 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 } | 506 } |
| 507 | 507 |
| 508 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
, | 508 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
, |
| 509 bool willBeMipped) { | 509 bool willBeMipped) { |
| 510 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped)); | 510 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped)); |
| 511 if (!original) { | 511 if (!original) { |
| 512 return nullptr; | 512 return nullptr; |
| 513 } | 513 } |
| 514 return copy_on_gpu(original, nullptr, copyParams); | 514 return copy_on_gpu(original, nullptr, copyParams); |
| 515 } | 515 } |
| OLD | NEW |