| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 /** | 521 /** |
| 522 * Handle to the 3D API object. | 522 * Handle to the 3D API object. |
| 523 * OpenGL: Texture ID. | 523 * OpenGL: Texture ID. |
| 524 */ | 524 */ |
| 525 GrBackendObject fTextureHandle; | 525 GrBackendObject fTextureHandle; |
| 526 }; | 526 }; |
| 527 | 527 |
| 528 /////////////////////////////////////////////////////////////////////////////// | 528 /////////////////////////////////////////////////////////////////////////////// |
| 529 | 529 |
| 530 /** | 530 /** |
| 531 * Optional bitfield flags that can be set on GrBackendRenderTargetDesc (below). |
| 532 */ |
| 533 enum GrBackendRenderTargetFlags { |
| 534 kNone_GrBackendRenderTargetFlags = 0x0, |
| 535 /** |
| 536 * Which buffers are multisampled (color and stencil, or just stencil?). |
| 537 * The default is both. Note that mixing multisampled and aliased buffers |
| 538 * is only possible if NV_framebuffer_mixed_samples is available. |
| 539 */ |
| 540 kStencilMSAAOnly_GrBackendRenderTargetFlags = 0x1, |
| 541 }; |
| 542 |
| 543 GR_MAKE_BITFIELD_OPS(GrBackendRenderTargetFlags) |
| 544 |
| 545 /** |
| 531 * Gr can wrap an existing render target created by the client in the 3D API | 546 * Gr can wrap an existing render target created by the client in the 3D API |
| 532 * with a GrRenderTarget object. The client is responsible for ensuring that the | 547 * with a GrRenderTarget object. The client is responsible for ensuring that the |
| 533 * underlying 3D API object lives at least as long as the GrRenderTarget object | 548 * underlying 3D API object lives at least as long as the GrRenderTarget object |
| 534 * wrapping it. We require the client to explicitly provide information about | 549 * wrapping it. We require the client to explicitly provide information about |
| 535 * the target, such as width, height, and pixel config rather than querying the | 550 * the target, such as width, height, and pixel config rather than querying the |
| 536 * 3D API for these values. We expect these properties to be immutable even if | 551 * 3D API for these values. We expect these properties to be immutable even if |
| 537 * the 3D API doesn't require this (OpenGL). | 552 * the 3D API doesn't require this (OpenGL). |
| 538 */ | 553 */ |
| 539 | 554 |
| 540 struct GrBackendRenderTargetDesc { | 555 struct GrBackendRenderTargetDesc { |
| 541 GrBackendRenderTargetDesc() { memset(this, 0, sizeof(*this)); } | 556 GrBackendRenderTargetDesc() { memset(this, 0, sizeof(*this)); } |
| 557 GrBackendRenderTargetFlags fFlags; |
| 542 int fWidth; //<! width in pixels | 558 int fWidth; //<! width in pixels |
| 543 int fHeight; //<! height in pixels | 559 int fHeight; //<! height in pixels |
| 544 GrPixelConfig fConfig; //<! color format | 560 GrPixelConfig fConfig; //<! color format |
| 545 GrSurfaceOrigin fOrigin; //<! pixel origin | 561 GrSurfaceOrigin fOrigin; //<! pixel origin |
| 546 /** | 562 /** |
| 547 * The number of samples per pixel. Gr uses this to influence decisions | 563 * The number of samples per pixel. Gr uses this to influence decisions |
| 548 * about applying other forms of anti-aliasing. | 564 * about applying other forms of anti-aliasing. |
| 549 */ | 565 */ |
| 550 int fSampleCnt; | 566 int fSampleCnt; |
| 551 /** | 567 /** |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 public: | 642 public: |
| 627 GrAutoMalloc() : INHERITED() {} | 643 GrAutoMalloc() : INHERITED() {} |
| 628 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 644 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
| 629 virtual ~GrAutoMalloc() {} | 645 virtual ~GrAutoMalloc() {} |
| 630 private: | 646 private: |
| 631 typedef GrAutoMallocBaseType INHERITED; | 647 typedef GrAutoMallocBaseType INHERITED; |
| 632 }; | 648 }; |
| 633 | 649 |
| 634 #undef GrAutoMallocBaseType | 650 #undef GrAutoMallocBaseType |
| 635 #endif | 651 #endif |
| OLD | NEW |