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

Side by Side Diff: dm/DMGpuSupport.h

Issue 1511613004: Revert of Make NVPR a GL context option instead of a GL context (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-02-other-tests-refactor
Patch Set: Created 5 years 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 12 matching lines...) Expand all
23 23
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,
34 GrGLStandard gpuAPI, 33 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, gpuAPI), SkSurface::k No_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 17 matching lines...) Expand all
69 68
70 static const GLContextType kANGLE_GLContextType = 0, 69 static const GLContextType kANGLE_GLContextType = 0,
71 kANGLE_GL_GLContextType = 0, 70 kANGLE_GL_GLContextType = 0,
72 kCommandBuffer_GLContextType = 0, 71 kCommandBuffer_GLContextType = 0,
73 kDebug_GLContextType = 0, 72 kDebug_GLContextType = 0,
74 kMESA_GLContextType = 0, 73 kMESA_GLContextType = 0,
75 kNVPR_GLContextType = 0, 74 kNVPR_GLContextType = 0,
76 kNative_GLContextType = 0, 75 kNative_GLContextType = 0,
77 kNull_GLContextType = 0; 76 kNull_GLContextType = 0;
78 static const int kGLContextTypeCnt = 1; 77 static const int kGLContextTypeCnt = 1;
79 enum GLContextOptions {
80 kNone_GLContextOptions = 0,
81 kEnableNVPR_GLContextOptions = 0x1,
82 };
83 void destroyContexts() {} 78 void destroyContexts() {}
84 79
85 void abandonContexts() {} 80 void abandonContexts() {}
86 }; 81 };
87 82
88 namespace DM { 83 namespace DM {
89 84
90 static const bool kGPUDisabled = true; 85 static const bool kGPUDisabled = true;
91 86
92 static inline SkSurface* NewGpuSurface(GrContextFactory*, 87 static inline SkSurface* NewGpuSurface(GrContextFactory*,
93 GrContextFactory::GLContextType, 88 GrContextFactory::GLContextType,
94 GrContextFactory::GLContextOptions,
95 GrGLStandard, 89 GrGLStandard,
96 SkImageInfo, 90 SkImageInfo,
97 int, 91 int,
98 bool) { 92 bool) {
99 return nullptr; 93 return nullptr;
100 } 94 }
101 95
102 } // namespace DM 96 } // namespace DM
103 97
104 #endif//SK_SUPPORT_GPU 98 #endif//SK_SUPPORT_GPU
105 99
106 #endif//DMGpuSupport_DEFINED 100 #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