| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (caps->isConfigRenderable(kSkia8888_GrPixelConfig, false)) { | 56 if (caps->isConfigRenderable(kSkia8888_GrPixelConfig, false)) { |
| 57 rtDesc.fConfig = kSkia8888_GrPixelConfig; | 57 rtDesc.fConfig = kSkia8888_GrPixelConfig; |
| 58 } else { | 58 } else { |
| 59 return nullptr; | 59 return nullptr; |
| 60 } | 60 } |
| 61 } else { | 61 } else { |
| 62 return nullptr; | 62 return nullptr; |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 SkAutoTUnref<GrTexture> copy(context->textureProvider()->createTexture(rtDes
c, | 66 SkAutoTUnref<GrTexture> copy(context->textureProvider()->createTexture(rtDes
c, true)); |
| 67 SkBud
geted::kYes)); | |
| 68 if (!copy) { | 67 if (!copy) { |
| 69 return nullptr; | 68 return nullptr; |
| 70 } | 69 } |
| 71 | 70 |
| 72 // TODO: If no scaling is being performed then use copySurface. | 71 // TODO: If no scaling is being performed then use copySurface. |
| 73 | 72 |
| 74 GrPaint paint; | 73 GrPaint paint; |
| 75 | 74 |
| 76 // TODO: Initializing these values for no reason cause the compiler is compl
aining | 75 // TODO: Initializing these values for no reason cause the compiler is compl
aining |
| 77 SkScalar sx = 0.f; | 76 SkScalar sx = 0.f; |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 filterOrNullForBicubic); | 498 filterOrNullForBicubic); |
| 500 } | 499 } |
| 501 | 500 |
| 502 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
) { | 501 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams
) { |
| 503 SkAutoTUnref<GrTexture> original(this->refOriginalTexture()); | 502 SkAutoTUnref<GrTexture> original(this->refOriginalTexture()); |
| 504 if (!original) { | 503 if (!original) { |
| 505 return nullptr; | 504 return nullptr; |
| 506 } | 505 } |
| 507 return copy_on_gpu(original, nullptr, copyParams); | 506 return copy_on_gpu(original, nullptr, copyParams); |
| 508 } | 507 } |
| OLD | NEW |