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

Side by Side Diff: dm/DMGpuSupport.h

Issue 848903004: Require budget decision when creating a RenderTarget SkSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make compatible with chrome Created 5 years, 11 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
OLDNEW
1 #ifndef DMGpuSupport_DEFINED 1 #ifndef DMGpuSupport_DEFINED
2 #define DMGpuSupport_DEFINED 2 #define DMGpuSupport_DEFINED
3 3
4 // Provides Ganesh to DM, 4 // Provides Ganesh to DM,
5 // or if it's not available, fakes it enough so most code doesn't have to know t hat. 5 // or if it's not available, fakes it enough so most code doesn't have to know t hat.
6 6
7 #include "SkSurface.h" 7 #include "SkSurface.h"
8 8
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 10
11 // Ganesh is available. Yippee! 11 // Ganesh is available. Yippee!
12 12
13 # include "GrContext.h" 13 # include "GrContext.h"
14 # include "GrContextFactory.h" 14 # include "GrContextFactory.h"
15 15
16 namespace DM { 16 namespace DM {
17 17
18 static const bool kGPUDisabled = false; 18 static const bool kGPUDisabled = false;
19 19
20 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory, 20 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory,
21 GrContextFactory::GLContextType type, 21 GrContextFactory::GLContextType type,
22 GrGLStandard gpuAPI, 22 GrGLStandard gpuAPI,
23 SkImageInfo info, 23 SkImageInfo info,
24 int samples, 24 int samples,
25 bool useDFText) { 25 bool useDFText) {
26 uint32_t flags = useDFText ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0 ; 26 uint32_t flags = useDFText ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0 ;
27 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); 27 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
28 return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), info, sample s, &props); 28 return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), SkSurface::k No_Budgeted,
29 info, samples, &props);
29 } 30 }
30 31
31 } // namespace DM 32 } // namespace DM
32 33
33 #else// !SK_SUPPORT_GPU 34 #else// !SK_SUPPORT_GPU
34 35
35 // Ganesh is not available. Fake it. 36 // Ganesh is not available. Fake it.
36 37
37 enum GrGLStandard { 38 enum GrGLStandard {
38 kNone_GrGLStandard, 39 kNone_GrGLStandard,
(...skipping 29 matching lines...) Expand all
68 int, 69 int,
69 bool) { 70 bool) {
70 return NULL; 71 return NULL;
71 } 72 }
72 73
73 } // namespace DM 74 } // namespace DM
74 75
75 #endif//SK_SUPPORT_GPU 76 #endif//SK_SUPPORT_GPU
76 77
77 #endif//DMGpuSupport_DEFINED 78 #endif//DMGpuSupport_DEFINED
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | expectations/gm/ignored-tests.txt » ('j') | gm/xfermodes3.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698