| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "gm.h" | 9 #include "gm.h" |
| 10 #include "GrContext.h" | |
| 11 #include "SkMipMap.h" | 10 #include "SkMipMap.h" |
| 12 #include "Resources.h" | 11 #include "Resources.h" |
| 13 | 12 |
| 14 #if SK_SUPPORT_GPU | 13 #if SK_SUPPORT_GPU |
| 14 #include "GrContext.h" |
| 15 | 15 |
| 16 // Helper function that uploads the given SkImage using MakdeFromDeferredTexture
ImageData and then | 16 // Helper function that uploads the given SkImage using MakdeFromDeferredTexture
ImageData and then |
| 17 // draws the uploaded version at the specified coordinates. | 17 // draws the uploaded version at the specified coordinates. |
| 18 static void DrawDeferredTextureImageData(SkCanvas* canvas, | 18 static void DrawDeferredTextureImageData(SkCanvas* canvas, |
| 19 SkImage::DeferredTextureImageUsageParam
s* params) { | 19 SkImage::DeferredTextureImageUsageParam
s* params) { |
| 20 GrContext* context = canvas->getGrContext(); | 20 GrContext* context = canvas->getGrContext(); |
| 21 if (!context) { | 21 if (!context) { |
| 22 skiagm::GM::DrawGpuOnlyMessage(canvas); | 22 skiagm::GM::DrawGpuOnlyMessage(canvas); |
| 23 return; | 23 return; |
| 24 } | 24 } |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 DrawDeferredTextureImageMipMapTree(canvas, decodedImage.get(), ¶ms); | 176 DrawDeferredTextureImageMipMapTree(canvas, decodedImage.get(), ¶ms); |
| 177 } | 177 } |
| 178 | 178 |
| 179 DEF_SIMPLE_GM(deferred_texture_image_high, canvas, 512 + 512 + 30, 512 + 20) { | 179 DEF_SIMPLE_GM(deferred_texture_image_high, canvas, 512 + 512 + 30, 512 + 20) { |
| 180 auto params = SkImage::DeferredTextureImageUsageParams(SkMatrix::MakeScale(1
.f, 1.f), | 180 auto params = SkImage::DeferredTextureImageUsageParams(SkMatrix::MakeScale(1
.f, 1.f), |
| 181 kHigh_SkFilterQuality
, 0); | 181 kHigh_SkFilterQuality
, 0); |
| 182 DrawDeferredTextureImageData(canvas, ¶ms); | 182 DrawDeferredTextureImageData(canvas, ¶ms); |
| 183 } | 183 } |
| 184 | 184 |
| 185 #endif | 185 #endif |
| OLD | NEW |