OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 * MSAA is not supported or recommended to be used by default. | 170 * MSAA is not supported or recommended to be used by default. |
171 */ | 171 */ |
172 int getRecommendedSampleCount(GrPixelConfig config, SkScalar dpi) const; | 172 int getRecommendedSampleCount(GrPixelConfig config, SkScalar dpi) const; |
173 | 173 |
174 /** | 174 /** |
175 * Returns a helper object to orchestrate draws. | 175 * Returns a helper object to orchestrate draws. |
176 * Callers should take a ref if they rely on the GrDrawContext sticking arou
nd. | 176 * Callers should take a ref if they rely on the GrDrawContext sticking arou
nd. |
177 * NULL will be returned if the context has been abandoned. | 177 * NULL will be returned if the context has been abandoned. |
178 * | 178 * |
179 * @param devProps the device properties (mainly defines text drawing) | 179 * @param devProps the device properties (mainly defines text drawing) |
180 * @param uesDFT should Distance Field Text be used? | |
181 * | 180 * |
182 * @return a draw context | 181 * @return a draw context |
183 */ | 182 */ |
184 GrDrawContext* drawContext(const SkDeviceProperties* devProps = NULL, bool u
seDFT = false) { | 183 GrDrawContext* drawContext(const SkDeviceProperties* devProps = NULL) { |
185 return fDrawingMgr.drawContext(devProps, useDFT); | 184 return fDrawingMgr.drawContext(devProps); |
186 } | 185 } |
187 | 186 |
188 /////////////////////////////////////////////////////////////////////////// | 187 /////////////////////////////////////////////////////////////////////////// |
189 // Misc. | 188 // Misc. |
190 | 189 |
191 /** | 190 /** |
192 * Flags that affect flush() behavior. | 191 * Flags that affect flush() behavior. |
193 */ | 192 */ |
194 enum FlushBits { | 193 enum FlushBits { |
195 /** | 194 /** |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 412 |
414 void abandon(); | 413 void abandon(); |
415 bool abandoned() const { return NULL == fDrawTarget; } | 414 bool abandoned() const { return NULL == fDrawTarget; } |
416 | 415 |
417 void purgeResources(); | 416 void purgeResources(); |
418 void reset(); | 417 void reset(); |
419 void flush(); | 418 void flush(); |
420 | 419 |
421 // Callers should take a ref if they rely on the GrDrawContext sticking
around. | 420 // Callers should take a ref if they rely on the GrDrawContext sticking
around. |
422 // NULL will be returned if the context has been abandoned. | 421 // NULL will be returned if the context has been abandoned. |
423 GrDrawContext* drawContext(const SkDeviceProperties* devProps, bool useD
FT); | 422 GrDrawContext* drawContext(const SkDeviceProperties* devProps); |
424 | 423 |
425 private: | 424 private: |
426 void cleanup(); | 425 void cleanup(); |
427 | 426 |
428 friend class GrContext; // for access to fDrawTarget for testing | 427 friend class GrContext; // for access to fDrawTarget for testing |
429 | 428 |
430 static const int kNumPixelGeometries = 5; // The different pixel geometr
ies | 429 static const int kNumPixelGeometries = 5; // The different pixel geometr
ies |
431 static const int kNumDFTOptions = 2; // DFT or no DFT | 430 static const int kNumDFTOptions = 2; // DFT or no DFT |
432 | 431 |
433 GrContext* fContext; | 432 GrContext* fContext; |
(...skipping 24 matching lines...) Expand all Loading... |
458 /** | 457 /** |
459 * A callback similar to the above for use by the TextBlobCache | 458 * A callback similar to the above for use by the TextBlobCache |
460 * TODO move textblob draw calls below context so we can use the call above. | 459 * TODO move textblob draw calls below context so we can use the call above. |
461 */ | 460 */ |
462 static void TextBlobCacheOverBudgetCB(void* data); | 461 static void TextBlobCacheOverBudgetCB(void* data); |
463 | 462 |
464 typedef SkRefCnt INHERITED; | 463 typedef SkRefCnt INHERITED; |
465 }; | 464 }; |
466 | 465 |
467 #endif | 466 #endif |
OLD | NEW |