OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrTypesPriv_DEFINED | 8 #ifndef GrTypesPriv_DEFINED |
9 #define GrTypesPriv_DEFINED | 9 #define GrTypesPriv_DEFINED |
10 | 10 |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 bool fEnabled; | 399 bool fEnabled; |
400 SkIRect fRect; | 400 SkIRect fRect; |
401 }; | 401 }; |
402 | 402 |
403 /** | 403 /** |
404 * Indicates the type of data that a GPU buffer will be used for. | 404 * Indicates the type of data that a GPU buffer will be used for. |
405 */ | 405 */ |
406 enum GrBufferType { | 406 enum GrBufferType { |
407 kVertex_GrBufferType, | 407 kVertex_GrBufferType, |
408 kIndex_GrBufferType, | 408 kIndex_GrBufferType, |
| 409 kTexel_GrBufferType, |
| 410 kDrawIndirect_GrBufferType, |
409 kXferCpuToGpu_GrBufferType, | 411 kXferCpuToGpu_GrBufferType, |
410 kXferGpuToCpu_GrBufferType, | 412 kXferGpuToCpu_GrBufferType, |
411 | 413 |
412 kLast_GrBufferType = kXferGpuToCpu_GrBufferType | 414 kLast_GrBufferType = kXferGpuToCpu_GrBufferType |
413 }; | 415 }; |
| 416 static const int kGrBufferTypeCount = kLast_GrBufferType + 1; |
| 417 |
| 418 static inline bool GrBufferTypeIsVertexOrIndex(GrBufferType type) { |
| 419 SkASSERT(type >= 0 && type < kGrBufferTypeCount); |
| 420 return type <= kIndex_GrBufferType; |
| 421 |
| 422 GR_STATIC_ASSERT(0 == kVertex_GrBufferType); |
| 423 GR_STATIC_ASSERT(1 == kIndex_GrBufferType); |
| 424 } |
414 | 425 |
415 /** | 426 /** |
416 * Provides a performance hint regarding the frequency at which a data store will
be accessed. | 427 * Provides a performance hint regarding the frequency at which a data store will
be accessed. |
417 */ | 428 */ |
418 enum GrAccessPattern { | 429 enum GrAccessPattern { |
419 /** Data store will be respecified repeatedly and used many times. */ | 430 /** Data store will be respecified repeatedly and used many times. */ |
420 kDynamic_GrAccessPattern, | 431 kDynamic_GrAccessPattern, |
421 /** Data store will be specified once and used many times. (Thus disqualifie
d from caching.) */ | 432 /** Data store will be specified once and used many times. (Thus disqualifie
d from caching.) */ |
422 kStatic_GrAccessPattern, | 433 kStatic_GrAccessPattern, |
423 /** Data store will be specified once and used at most a few times. (Also ca
n't be cached.) */ | 434 /** Data store will be specified once and used at most a few times. (Also ca
n't be cached.) */ |
424 kStream_GrAccessPattern, | 435 kStream_GrAccessPattern, |
425 | 436 |
426 kLast_GrAccessPattern = kStream_GrAccessPattern | 437 kLast_GrAccessPattern = kStream_GrAccessPattern |
427 }; | 438 }; |
428 | 439 |
429 | 440 |
430 #ifdef SK_DEBUG | 441 #ifdef SK_DEBUG |
431 // Takes a pointer to a GrCaps, and will suppress prints if required | 442 // Takes a pointer to a GrCaps, and will suppress prints if required |
432 #define GrCapsDebugf(caps, ...) \ | 443 #define GrCapsDebugf(caps, ...) \ |
433 if (!caps->suppressPrints()) { \ | 444 if (!caps->suppressPrints()) { \ |
434 SkDebugf(__VA_ARGS__); \ | 445 SkDebugf(__VA_ARGS__); \ |
435 } | 446 } |
436 #else | 447 #else |
437 #define GrCapsDebugf(caps, ...) | 448 #define GrCapsDebugf(caps, ...) |
438 #endif | 449 #endif |
439 | 450 |
440 #endif | 451 #endif |
OLD | NEW |