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, | |
411 kXferCpuToGpu_GrBufferType, | 409 kXferCpuToGpu_GrBufferType, |
412 kXferGpuToCpu_GrBufferType, | 410 kXferGpuToCpu_GrBufferType, |
413 | 411 |
414 kLast_GrBufferType = kXferGpuToCpu_GrBufferType | 412 kLast_GrBufferType = kXferGpuToCpu_GrBufferType |
415 }; | 413 }; |
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 } | |
425 | 414 |
426 /** | 415 /** |
427 * Provides a performance hint regarding the frequency at which a data store will
be accessed. | 416 * Provides a performance hint regarding the frequency at which a data store will
be accessed. |
428 */ | 417 */ |
429 enum GrAccessPattern { | 418 enum GrAccessPattern { |
430 /** Data store will be respecified repeatedly and used many times. */ | 419 /** Data store will be respecified repeatedly and used many times. */ |
431 kDynamic_GrAccessPattern, | 420 kDynamic_GrAccessPattern, |
432 /** Data store will be specified once and used many times. (Thus disqualifie
d from caching.) */ | 421 /** Data store will be specified once and used many times. (Thus disqualifie
d from caching.) */ |
433 kStatic_GrAccessPattern, | 422 kStatic_GrAccessPattern, |
434 /** Data store will be specified once and used at most a few times. (Also ca
n't be cached.) */ | 423 /** Data store will be specified once and used at most a few times. (Also ca
n't be cached.) */ |
435 kStream_GrAccessPattern, | 424 kStream_GrAccessPattern, |
436 | 425 |
437 kLast_GrAccessPattern = kStream_GrAccessPattern | 426 kLast_GrAccessPattern = kStream_GrAccessPattern |
438 }; | 427 }; |
439 | 428 |
440 | 429 |
441 #ifdef SK_DEBUG | 430 #ifdef SK_DEBUG |
442 // Takes a pointer to a GrCaps, and will suppress prints if required | 431 // Takes a pointer to a GrCaps, and will suppress prints if required |
443 #define GrCapsDebugf(caps, ...) \ | 432 #define GrCapsDebugf(caps, ...) \ |
444 if (!caps->suppressPrints()) { \ | 433 if (!caps->suppressPrints()) { \ |
445 SkDebugf(__VA_ARGS__); \ | 434 SkDebugf(__VA_ARGS__); \ |
446 } | 435 } |
447 #else | 436 #else |
448 #define GrCapsDebugf(caps, ...) | 437 #define GrCapsDebugf(caps, ...) |
449 #endif | 438 #endif |
450 | 439 |
451 #endif | 440 #endif |
OLD | NEW |