OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef GrTypes_DEFINED | 9 #ifndef GrTypes_DEFINED |
10 #define GrTypes_DEFINED | 10 #define GrTypes_DEFINED |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 enum GrClipType { | 467 enum GrClipType { |
468 kRect_ClipType, | 468 kRect_ClipType, |
469 kPath_ClipType | 469 kPath_ClipType |
470 }; | 470 }; |
471 | 471 |
472 /////////////////////////////////////////////////////////////////////////////// | 472 /////////////////////////////////////////////////////////////////////////////// |
473 | 473 |
474 // opaque type for 3D API object handles | 474 // opaque type for 3D API object handles |
475 typedef intptr_t GrBackendObject; | 475 typedef intptr_t GrBackendObject; |
476 | 476 |
| 477 |
| 478 /** Ownership rules for external GPU resources imported into Skia. */ |
| 479 enum GrWrapOwnership { |
| 480 /** Skia will assume the client will keep the resource alive and Skia will n
ot free it. */ |
| 481 kBorrow_GrWrapOwnership, |
| 482 |
| 483 /** Skia will assume ownership of the resource and free it. */ |
| 484 kAdopt_GrWrapOwnership, |
| 485 }; |
| 486 |
477 /** | 487 /** |
478 * Gr can wrap an existing texture created by the client with a GrTexture | 488 * Gr can wrap an existing texture created by the client with a GrTexture |
479 * object. The client is responsible for ensuring that the texture lives at | 489 * object. The client is responsible for ensuring that the texture lives at |
480 * least as long as the GrTexture object wrapping it. We require the client to | 490 * least as long as the GrTexture object wrapping it. We require the client to |
481 * explicitly provide information about the texture, such as width, height, | 491 * explicitly provide information about the texture, such as width, height, |
482 * and pixel config, rather than querying the 3D APIfor these values. We expect | 492 * and pixel config, rather than querying the 3D APIfor these values. We expect |
483 * these to be immutable even if the 3D API doesn't require this (OpenGL). | 493 * these to be immutable even if the 3D API doesn't require this (OpenGL). |
484 * | 494 * |
485 * Textures that are also render targets are supported as well. Gr will manage | 495 * Textures that are also render targets are supported as well. Gr will manage |
486 * any ancillary 3D API (stencil buffer, FBO id, etc) objects necessary for | 496 * any ancillary 3D API (stencil buffer, FBO id, etc) objects necessary for |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 return 4 * width * height; | 620 return 4 * width * height; |
611 } | 621 } |
612 } | 622 } |
613 | 623 |
614 /** | 624 /** |
615 * This value translates to reseting all the context state for any backend. | 625 * This value translates to reseting all the context state for any backend. |
616 */ | 626 */ |
617 static const uint32_t kAll_GrBackendState = 0xffffffff; | 627 static const uint32_t kAll_GrBackendState = 0xffffffff; |
618 | 628 |
619 #endif | 629 #endif |
OLD | NEW |