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

Side by Side Diff: dm/DMGpuSupport.h

Issue 1490113005: Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
Patch Set: Created 4 years, 12 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 | « dm/DM.cpp ('k') | dm/DMSrcSink.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 #ifndef DMGpuSupport_DEFINED 8 #ifndef DMGpuSupport_DEFINED
9 #define DMGpuSupport_DEFINED 9 #define DMGpuSupport_DEFINED
10 10
(...skipping 13 matching lines...) Expand all
24 # include "GrContext.h" 24 # include "GrContext.h"
25 # include "GrContextFactory.h" 25 # include "GrContextFactory.h"
26 26
27 namespace DM { 27 namespace DM {
28 28
29 static const bool kGPUDisabled = false; 29 static const bool kGPUDisabled = false;
30 30
31 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory, 31 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory,
32 GrContextFactory::GLContextType type, 32 GrContextFactory::GLContextType type,
33 GrContextFactory::GLContextOptions option s, 33 GrContextFactory::GLContextOptions option s,
34 GrGLStandard gpuAPI,
35 SkImageInfo info, 34 SkImageInfo info,
36 int samples, 35 int samples,
37 bool useDIText) { 36 bool useDIText) {
38 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag : 0; 37 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag : 0;
39 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); 38 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
40 return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI, options), 39 return SkSurface::NewRenderTarget(grFactory->get(type, options), SkSurface:: kNo_Budgeted,
41 SkSurface::kNo_Budgeted, info, samples, &p rops); 40 info, samples, &props);
42 } 41 }
43 42
44 } // namespace DM 43 } // namespace DM
45 44
46 #else// !SK_SUPPORT_GPU 45 #else// !SK_SUPPORT_GPU
47 46
48 // Ganesh is not available. Fake it. 47 // Ganesh is not available. Fake it.
49 48
50 enum GrGLStandard { 49 enum GrGLStandard {
51 kNone_GrGLStandard, 50 kNone_GrGLStandard,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 void abandonContexts() {} 84 void abandonContexts() {}
86 }; 85 };
87 86
88 namespace DM { 87 namespace DM {
89 88
90 static const bool kGPUDisabled = true; 89 static const bool kGPUDisabled = true;
91 90
92 static inline SkSurface* NewGpuSurface(GrContextFactory*, 91 static inline SkSurface* NewGpuSurface(GrContextFactory*,
93 GrContextFactory::GLContextType, 92 GrContextFactory::GLContextType,
94 GrContextFactory::GLContextOptions, 93 GrContextFactory::GLContextOptions,
95 GrGLStandard,
96 SkImageInfo, 94 SkImageInfo,
97 int, 95 int,
98 bool) { 96 bool) {
99 return nullptr; 97 return nullptr;
100 } 98 }
101 99
102 } // namespace DM 100 } // namespace DM
103 101
104 #endif//SK_SUPPORT_GPU 102 #endif//SK_SUPPORT_GPU
105 103
106 #endif//DMGpuSupport_DEFINED 104 #endif//DMGpuSupport_DEFINED
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698