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 GrTypes_DEFINED | 8 #ifndef GrTypes_DEFINED |
9 #define GrTypes_DEFINED | 9 #define GrTypes_DEFINED |
10 | 10 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
418 * should be verified. | 418 * should be verified. |
419 */ | 419 */ |
420 kCheckAllocation_GrSurfaceFlag = 0x4, | 420 kCheckAllocation_GrSurfaceFlag = 0x4, |
421 }; | 421 }; |
422 | 422 |
423 GR_MAKE_BITFIELD_OPS(GrSurfaceFlags) | 423 GR_MAKE_BITFIELD_OPS(GrSurfaceFlags) |
424 | 424 |
425 // opaque type for 3D API object handles | 425 // opaque type for 3D API object handles |
426 typedef intptr_t GrBackendObject; | 426 typedef intptr_t GrBackendObject; |
427 | 427 |
428 enum class GrBackendObjectLifeCycle { | |
bsalomon
2016/04/19 14:37:46
Seems a bit concusing that we call this BackendObj
Kimmo Kinnunen
2016/04/20 12:04:55
The "backend object" here means GL object or Vulka
| |
429 /** | |
430 * The object is created and owned by Skia. Objects with this status may be kept alive | |
431 * by the cache as either part of scratch or unique resources even when ther e are no refs to | |
432 * the resources. | |
433 * The cache may release the resources whenever there are no refs. | |
434 */ | |
435 kInternal, | |
436 | |
437 /** | |
438 * Skia does not manage the lifetime of the backend 3D API object. The clien t is | |
439 * responsible for freeing the object. Used to inject client- created GPU re sources into Skia | |
440 * (e.g. to render to a client-created texture). | |
441 */ | |
442 kBorrowed, | |
443 | |
444 /** | |
445 * An external object with ownership transfered into Skia. Skia will free th e object. | |
446 */ | |
447 kAdopted | |
448 }; | |
449 | |
450 | |
428 /** | 451 /** |
429 * Some textures will be stored such that the upper and left edges of the conten t meet at the | 452 * Some textures will be stored such that the upper and left edges of the conten t meet at the |
430 * the origin (in texture coord space) and for other textures the lower and left edges meet at | 453 * the origin (in texture coord space) and for other textures the lower and left edges meet at |
431 * the origin. kDefault_GrSurfaceOrigin sets textures to TopLeft, and render tar gets | 454 * the origin. kDefault_GrSurfaceOrigin sets textures to TopLeft, and render tar gets |
432 * to BottomLeft. | 455 * to BottomLeft. |
433 */ | 456 */ |
434 | 457 |
435 enum GrSurfaceOrigin { | 458 enum GrSurfaceOrigin { |
436 kDefault_GrSurfaceOrigin, // DEPRECATED; to be removed | 459 kDefault_GrSurfaceOrigin, // DEPRECATED; to be removed |
437 kTopLeft_GrSurfaceOrigin, | 460 kTopLeft_GrSurfaceOrigin, |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 return 4 * width * height; | 720 return 4 * width * height; |
698 } | 721 } |
699 } | 722 } |
700 | 723 |
701 /** | 724 /** |
702 * This value translates to reseting all the context state for any backend. | 725 * This value translates to reseting all the context state for any backend. |
703 */ | 726 */ |
704 static const uint32_t kAll_GrBackendState = 0xffffffff; | 727 static const uint32_t kAll_GrBackendState = 0xffffffff; |
705 | 728 |
706 #endif | 729 #endif |
OLD | NEW |