| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 bool enabled() const { return fEnabled; } | 395 bool enabled() const { return fEnabled; } |
| 396 const SkIRect& rect() const { return fRect; } | 396 const SkIRect& rect() const { return fRect; } |
| 397 | 397 |
| 398 private: | 398 private: |
| 399 bool fEnabled; | 399 bool fEnabled; |
| 400 SkIRect fRect; | 400 SkIRect fRect; |
| 401 }; | 401 }; |
| 402 | 402 |
| 403 /** | 403 /** |
| 404 * Indicates the transfer direction for a transfer buffer | 404 * Indicates the type of data that a GPU buffer will be used for. |
| 405 */ | 405 */ |
| 406 enum TransferType { | 406 enum GrBufferType { |
| 407 /** Caller intends to use the buffer to transfer data to the GPU */ | 407 kVertex_GrBufferType, |
| 408 kCpuToGpu_TransferType, | 408 kIndex_GrBufferType, |
| 409 /** Caller intends to use the buffer to transfer data from the GPU */ | 409 kXferCpuToGpu_GrBufferType, |
| 410 kGpuToCpu_TransferType | 410 kXferGpuToCpu_GrBufferType, |
| 411 |
| 412 kLast_GrBufferType = kXferGpuToCpu_GrBufferType |
| 413 }; |
| 414 |
| 415 /** |
| 416 * Provides a performance hint regarding the frequency at which a data store will
be accessed. |
| 417 */ |
| 418 enum GrAccessPattern { |
| 419 /** Data store will be respecified repeatedly and used many times. */ |
| 420 kDynamic_GrAccessPattern, |
| 421 /** Data store will be specified once and used many times. (Thus disqualifie
d from caching.) */ |
| 422 kStatic_GrAccessPattern, |
| 423 /** Data store will be specified once and used at most a few times. (Also ca
n't be cached.) */ |
| 424 kStream_GrAccessPattern, |
| 425 |
| 426 kLast_GrAccessPattern = kStream_GrAccessPattern |
| 411 }; | 427 }; |
| 412 | 428 |
| 413 | 429 |
| 414 #ifdef SK_DEBUG | 430 #ifdef SK_DEBUG |
| 415 // 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 |
| 416 #define GrCapsDebugf(caps, ...) \ | 432 #define GrCapsDebugf(caps, ...) \ |
| 417 if (!caps->suppressPrints()) { \ | 433 if (!caps->suppressPrints()) { \ |
| 418 SkDebugf(__VA_ARGS__); \ | 434 SkDebugf(__VA_ARGS__); \ |
| 419 } | 435 } |
| 420 #else | 436 #else |
| 421 #define GrCapsDebugf(caps, ...) | 437 #define GrCapsDebugf(caps, ...) |
| 422 #endif | 438 #endif |
| 423 | 439 |
| 424 #endif | 440 #endif |
| OLD | NEW |