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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
416 * to BottomLeft. | 416 * to BottomLeft. |
417 */ | 417 */ |
418 | 418 |
419 enum GrSurfaceOrigin { | 419 enum GrSurfaceOrigin { |
420 kDefault_GrSurfaceOrigin, // DEPRECATED; to be removed | 420 kDefault_GrSurfaceOrigin, // DEPRECATED; to be removed |
421 kTopLeft_GrSurfaceOrigin, | 421 kTopLeft_GrSurfaceOrigin, |
422 kBottomLeft_GrSurfaceOrigin, | 422 kBottomLeft_GrSurfaceOrigin, |
423 }; | 423 }; |
424 | 424 |
425 /** | 425 /** |
426 * Sample config clarifies the meaning of samples count. | |
427 * In default kUnified_GrSampleConfig sample count refers to MSAA sample count. | |
428 * If NV_framebuffer_mixed_samples is available and sample config is chosen to b e | |
429 * kStencil_GrSampleConfig, sample count refers to the stencil sample count only , | |
430 * and the color sample count is assumed to be zero. | |
431 */ | |
432 enum GrSampleConfig { | |
433 kUnified_GrSampleConfig, | |
434 kStencil_GrSampleConfig, | |
435 }; | |
436 | |
437 /** | |
438 * Pipeline stage serves as a query parameter to render target's isMultisampled | |
439 * and numSamples methods. It signifies whether the caller is interested in | |
440 * multisampling in color buffer or stencil buffer specifically, both, or any of | |
441 * the two. Used by the NV_framebuffer_mixed_samples implementation. | |
442 */ | |
Chris Dalton
2015/03/19 12:07:41
I think this enum belongs inside the GrRenderTarge
| |
443 enum GrPipelineStage { | |
444 kColorBuffer_GrPipelineStage, | |
445 kStencilBuffer_GrPipelineStage, | |
446 kEverywhere_GrPipelineStage = kColorBuffer_GrPipelineStage, | |
447 kAnywhere_GrPipelineStage = kStencilBuffer_GrPipelineStage, | |
448 kRaster_GrPipelineStage = kStencilBuffer_GrPipelineStage | |
Chris Dalton
2015/03/19 12:07:41
We maybe don't have to include kRaster for now. So
| |
449 }; | |
450 | |
451 /** | |
426 * Describes a surface to be created. | 452 * Describes a surface to be created. |
427 */ | 453 */ |
428 struct GrSurfaceDesc { | 454 struct GrSurfaceDesc { |
429 GrSurfaceDesc() | 455 GrSurfaceDesc() |
430 : fFlags(kNone_GrSurfaceFlags) | 456 : fFlags(kNone_GrSurfaceFlags) |
431 , fOrigin(kDefault_GrSurfaceOrigin) | 457 , fOrigin(kDefault_GrSurfaceOrigin) |
432 , fWidth(0) | 458 , fWidth(0) |
433 , fHeight(0) | 459 , fHeight(0) |
434 , fConfig(kUnknown_GrPixelConfig) | 460 , fConfig(kUnknown_GrPixelConfig) |
435 , fSampleCnt(0) { | 461 , fSampleCnt(0) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
542 int fWidth; //<! width in pixels | 568 int fWidth; //<! width in pixels |
543 int fHeight; //<! height in pixels | 569 int fHeight; //<! height in pixels |
544 GrPixelConfig fConfig; //<! color format | 570 GrPixelConfig fConfig; //<! color format |
545 GrSurfaceOrigin fOrigin; //<! pixel origin | 571 GrSurfaceOrigin fOrigin; //<! pixel origin |
546 /** | 572 /** |
547 * The number of samples per pixel. Gr uses this to influence decisions | 573 * The number of samples per pixel. Gr uses this to influence decisions |
548 * about applying other forms of anti-aliasing. | 574 * about applying other forms of anti-aliasing. |
549 */ | 575 */ |
550 int fSampleCnt; | 576 int fSampleCnt; |
551 /** | 577 /** |
578 * If fSampleCnt is > 1, which buffers are multisampled (color and stencil, | |
579 * or just stencil?). The default is both. Note that mixing multisampled | |
580 * and aliased buffers is only possible if NV_framebuffer_mixed_samples is | |
581 * available. | |
582 */ | |
583 GrSampleConfig fSampleConfig; | |
584 /** | |
552 * Number of bits of stencil per-pixel. | 585 * Number of bits of stencil per-pixel. |
553 */ | 586 */ |
554 int fStencilBits; | 587 int fStencilBits; |
555 /** | 588 /** |
556 * Handle to the 3D API object. | 589 * Handle to the 3D API object. |
557 * OpenGL: FBO ID | 590 * OpenGL: FBO ID |
558 */ | 591 */ |
559 GrBackendObject fRenderTargetHandle; | 592 GrBackendObject fRenderTargetHandle; |
560 }; | 593 }; |
561 | 594 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 public: | 659 public: |
627 GrAutoMalloc() : INHERITED() {} | 660 GrAutoMalloc() : INHERITED() {} |
628 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 661 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
629 virtual ~GrAutoMalloc() {} | 662 virtual ~GrAutoMalloc() {} |
630 private: | 663 private: |
631 typedef GrAutoMallocBaseType INHERITED; | 664 typedef GrAutoMallocBaseType INHERITED; |
632 }; | 665 }; |
633 | 666 |
634 #undef GrAutoMallocBaseType | 667 #undef GrAutoMallocBaseType |
635 #endif | 668 #endif |
OLD | NEW |