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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 if (this->width() < ctx->caps()->minTextureSize() || | 134 if (this->width() < ctx->caps()->minTextureSize() || |
135 this->height() < ctx->caps()->minTextureSize()) | 135 this->height() < ctx->caps()->minTextureSize()) |
136 { | 136 { |
137 // we can't trust our ability to use HW to perform the stretch, so we re
quest | 137 // we can't trust our ability to use HW to perform the stretch, so we re
quest |
138 // a raster instead, and perform the stretch on the CPU. | 138 // a raster instead, and perform the stretch on the CPU. |
139 SkBitmap bitmap; | 139 SkBitmap bitmap; |
140 if (!this->getROBitmap(&bitmap)) { | 140 if (!this->getROBitmap(&bitmap)) { |
141 return nullptr; | 141 return nullptr; |
142 } | 142 } |
143 SkBitmap stretchedBmp = copy_on_cpu(bitmap, copyParams); | 143 SkBitmap stretchedBmp = copy_on_cpu(bitmap, copyParams); |
144 return GrUploadBitmapToTexture(ctx, bitmap); | 144 return GrUploadBitmapToTexture(ctx, stretchedBmp); |
145 } else { | 145 } else { |
146 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(ctx)); | 146 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(ctx)); |
147 if (!original) { | 147 if (!original) { |
148 return nullptr; | 148 return nullptr; |
149 } | 149 } |
150 return copy_on_gpu(original, copyParams); | 150 return copy_on_gpu(original, copyParams); |
151 } | 151 } |
152 } | 152 } |
OLD | NEW |