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

Side by Side Diff: dm/DMGpuSupport.h

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « cmake/example.cpp ('k') | dm/DMSrcSink.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 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 10 matching lines...) Expand all
21 21
22 // Ganesh is available. Yippee! 22 // Ganesh is available. Yippee!
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 sk_sp<SkSurface> NewGpuSurface(GrContextFactory* grFactory,
32 GrContextFactory::GLContextType type, 32 GrContextFactory::GLContextType typ e,
33 GrContextFactory::GLContextOptions option s, 33 GrContextFactory::GLContextOptions options,
34 SkImageInfo info, 34 SkImageInfo info,
35 int samples, 35 int samples,
36 bool useDIText) { 36 bool useDIText) {
37 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag : 0; 37 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag : 0;
38 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); 38 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
39 return SkSurface::NewRenderTarget(grFactory->get(type, options), SkBudgeted: :kNo, 39 return SkSurface::MakeRenderTarget(grFactory->get(type, options), SkBudgeted ::kNo,
40 info, samples, &props); 40 info, samples, &props);
41 } 41 }
42 42
43 } // namespace DM 43 } // namespace DM
44 44
45 #else// !SK_SUPPORT_GPU 45 #else// !SK_SUPPORT_GPU
46 46
47 // Ganesh is not available. Fake it. 47 // Ganesh is not available. Fake it.
48 48
49 enum GrGLStandard { 49 enum GrGLStandard {
50 kNone_GrGLStandard, 50 kNone_GrGLStandard,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 int, 95 int,
96 bool) { 96 bool) {
97 return nullptr; 97 return nullptr;
98 } 98 }
99 99
100 } // namespace DM 100 } // namespace DM
101 101
102 #endif//SK_SUPPORT_GPU 102 #endif//SK_SUPPORT_GPU
103 103
104 #endif//DMGpuSupport_DEFINED 104 #endif//DMGpuSupport_DEFINED
OLDNEW
« no previous file with comments | « cmake/example.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698