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

Side by Side Diff: include/core/SkGraphics.h

Issue 1229933003: add runtime option to provide data->imagegenerator factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 5 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 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkGraphics_DEFINED 8 #ifndef SkGraphics_DEFINED
9 #define SkGraphics_DEFINED 9 #define SkGraphics_DEFINED
10 10
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 12
13 class SkData;
14 class SkImageGenerator;
15
13 class SK_API SkGraphics { 16 class SK_API SkGraphics {
14 public: 17 public:
15 /** 18 /**
16 * Call this at process initialization time if your environment does not 19 * Call this at process initialization time if your environment does not
17 * permit static global initializers that execute code. Note that 20 * permit static global initializers that execute code. Note that
18 * Init() is not thread-safe. 21 * Init() is not thread-safe.
19 */ 22 */
20 static void Init(); 23 static void Init();
21 24
22 /** 25 /**
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 * GetFontCacheLimit. 136 * GetFontCacheLimit.
134 */ 137 */
135 static size_t GetTLSFontCacheLimit(); 138 static size_t GetTLSFontCacheLimit();
136 139
137 /** 140 /**
138 * Specify the max number of bytes that should be used by the thread-local 141 * Specify the max number of bytes that should be used by the thread-local
139 * font cache. If this value is 0, then this thread will use the shared 142 * font cache. If this value is 0, then this thread will use the shared
140 * global font cache. 143 * global font cache.
141 */ 144 */
142 static void SetTLSFontCacheLimit(size_t bytes); 145 static void SetTLSFontCacheLimit(size_t bytes);
146
147 typedef SkImageGenerator* (*ImageGeneratorFromEncodedFactory)(SkData*);
148
149 /**
150 * To instantiate images from encoded data, first looks at this runtime fun ction-ptr. If it
151 * exists, it is called to create an SkImageGenerator from SkData. If there is no function-ptr
152 * or there is, but it returns NULL, then skia will call its internal defau lt implementation.
153 */
154 static ImageGeneratorFromEncodedFactory GetImageGeneratorFromEncodedFactory( );
scroggo 2015/07/09 19:01:15 I do not understand the need for this accessor. Wh
mtklein 2015/07/09 19:04:57 I guess we could merge the two as static ImagGene
reed1 2015/07/09 19:05:45 Not sure what to do here. Having a global is just
155 static void SetImageGeneratorFromEncodedFactory(ImageGeneratorFromEncodedFac tory);
143 }; 156 };
144 157
145 class SkAutoGraphics { 158 class SkAutoGraphics {
146 public: 159 public:
147 SkAutoGraphics() { 160 SkAutoGraphics() {
148 SkGraphics::Init(); 161 SkGraphics::Init();
149 } 162 }
150 ~SkAutoGraphics() { 163 ~SkAutoGraphics() {
151 SkGraphics::Term(); 164 SkGraphics::Term();
152 } 165 }
153 }; 166 };
154 167
155 #endif 168 #endif
OLDNEW
« no previous file with comments | « gm/mipmap.cpp ('k') | include/core/SkImageGenerator.h » ('j') | include/core/SkImageGenerator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698