Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: include/gpu/GrTypesPriv.h

Issue 1870553002: Revert of Track GL buffer state based on unique resource ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/GrBuffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698