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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 * | 180 * |
181 * @return a draw context | 181 * @return a draw context |
182 */ | 182 */ |
183 GrDrawContext* drawContext(const SkDeviceProperties* devProps = NULL) { | 183 GrDrawContext* drawContext(const SkSurfaceProps* surfaceProps = NULL) { |
184 return fDrawingMgr.drawContext(devProps); | 184 return fDrawingMgr.drawContext(surfaceProps); |
185 } | 185 } |
186 | 186 |
187 /////////////////////////////////////////////////////////////////////////// | 187 /////////////////////////////////////////////////////////////////////////// |
188 // Misc. | 188 // Misc. |
189 | 189 |
190 /** | 190 /** |
191 * Flags that affect flush() behavior. | 191 * Flags that affect flush() behavior. |
192 */ | 192 */ |
193 enum FlushBits { | 193 enum FlushBits { |
194 /** | 194 /** |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 412 |
413 void abandon(); | 413 void abandon(); |
414 bool abandoned() const { return NULL == fDrawTarget; } | 414 bool abandoned() const { return NULL == fDrawTarget; } |
415 | 415 |
416 void purgeResources(); | 416 void purgeResources(); |
417 void reset(); | 417 void reset(); |
418 void flush(); | 418 void flush(); |
419 | 419 |
420 // 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. |
421 // NULL will be returned if the context has been abandoned. | 421 // NULL will be returned if the context has been abandoned. |
422 GrDrawContext* drawContext(const SkDeviceProperties* devProps); | 422 GrDrawContext* drawContext(const SkSurfaceProps* surfaceProps); |
423 | 423 |
424 private: | 424 private: |
425 void cleanup(); | 425 void cleanup(); |
426 | 426 |
427 friend class GrContext; // for access to fDrawTarget for testing | 427 friend class GrContext; // for access to fDrawTarget for testing |
428 | 428 |
429 static const int kNumPixelGeometries = 5; // The different pixel geometr
ies | 429 static const int kNumPixelGeometries = 5; // The different pixel geometr
ies |
430 static const int kNumDFTOptions = 2; // DFT or no DFT | 430 static const int kNumDFTOptions = 2; // DFT or no DFT |
431 | 431 |
432 GrContext* fContext; | 432 GrContext* fContext; |
(...skipping 24 matching lines...) Expand all Loading... |
457 /** | 457 /** |
458 * A callback similar to the above for use by the TextBlobCache | 458 * A callback similar to the above for use by the TextBlobCache |
459 * 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. |
460 */ | 460 */ |
461 static void TextBlobCacheOverBudgetCB(void* data); | 461 static void TextBlobCacheOverBudgetCB(void* data); |
462 | 462 |
463 typedef SkRefCnt INHERITED; | 463 typedef SkRefCnt INHERITED; |
464 }; | 464 }; |
465 | 465 |
466 #endif | 466 #endif |
OLD | NEW |