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