Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(965)

Side by Side Diff: gm/deferredtextureimage.cpp

Issue 2347593002: Fix SampleApp compilation with skia_gpu=0 (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | samplecode/SampleApp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
176 DrawDeferredTextureImageMipMapTree(canvas, decodedImage.get(), &params); 176 DrawDeferredTextureImageMipMapTree(canvas, decodedImage.get(), &params);
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, &params); 182 DrawDeferredTextureImageData(canvas, &params);
183 } 183 }
184 184
185 #endif 185 #endif
OLDNEW
« no previous file with comments | « no previous file | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698