Chromium Code Reviews| Index: src/gpu/GrPipelineBuilder.h |
| diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrPipelineBuilder.h |
| similarity index 86% |
| rename from src/gpu/GrDrawState.h |
| rename to src/gpu/GrPipelineBuilder.h |
| index 45fc574bde78c8b5a511d8223f5133f16efe9b6d..5fd16069a245ef2a9b9657cc1e24739400e57250 100644 |
| --- a/src/gpu/GrDrawState.h |
| +++ b/src/gpu/GrPipelineBuilder.h |
| @@ -1,12 +1,12 @@ |
| /* |
| - * Copyright 2011 Google Inc. |
| + * Copyright 2015 Google Inc. |
| * |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| */ |
| -#ifndef GrDrawState_DEFINED |
| -#define GrDrawState_DEFINED |
| +#ifndef GrPipelineBuilder_DEFINED |
| +#define GrPipelineBuilder_DEFINED |
| #include "GrBlend.h" |
| @@ -28,22 +28,23 @@ class GrDrawTargetCaps; |
| class GrPaint; |
| class GrTexture; |
| -class GrDrawState { |
| +class GrPipelineBuilder { |
| public: |
| - GrDrawState(); |
| + GrPipelineBuilder(); |
| + |
| /** |
| - * Copies another draw state. |
| + * Copies another pipeline builder. |
| **/ |
| - GrDrawState(const GrDrawState& state) { |
| + GrPipelineBuilder(const GrPipelineBuilder& state) { |
| SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) |
| *this = state; |
| } |
| - virtual ~GrDrawState(); |
| + virtual ~GrPipelineBuilder(); |
| /** |
| - * Initializes the GrDrawState based on a GrPaint, view matrix and render target. Note that |
| - * GrDrawState encompasses more than GrPaint. Aspects of GrDrawState that have no GrPaint |
| + * Initializes the GrPipelineBuilder based on a GrPaint, view matrix and render target. Note that |
| + * GrPipelineBuilder encompasses more than GrPaint. Aspects of GrPipelineBuilder that have no GrPaint |
|
joshualitt
2015/01/22 15:55:08
\n
egdaniel
2015/01/22 16:28:56
Done.
|
| * equivalents are set to default values with the exception of vertex attribute state which |
| * is unmodified by this function and clipping which will be enabled. |
| */ |
| @@ -56,7 +57,7 @@ public: |
| * it may or may not be possible to correctly blend with fractional pixel coverage generated by |
| * the fragment shader. |
| * |
| - * This function considers the current draw state and the draw target's capabilities to |
| + * This function considers the current pipeline builder and the draw target's capabilities to |
|
joshualitt
2015/01/22 15:55:08
Gr
egdaniel
2015/01/22 16:28:56
Done.
|
| * determine whether coverage can be handled correctly. This function assumes that the caller |
| * intends to specify fractional pixel coverage via a primitive processor but may not have |
| * specified it yet. |
| @@ -171,30 +172,23 @@ public: |
| } |
| /** |
| - * When this object is destroyed it will remove any color/coverage effects from the draw state |
| - * that were added after its constructor. |
| - * |
| - * This class has strange behavior around geometry processor. If there is a GP on the draw state |
| - * it will assert that the GP is not modified until after the destructor of the ARE. If the |
| - * draw state has a NULL GP when the ARE is constructed then it will reset it to null in the |
| - * destructor. |
| + * When this object is destroyed it will remove any color/coverage effects from the pipeline |
|
joshualitt
2015/01/22 15:55:08
Gr
egdaniel
2015/01/22 16:28:56
Done.
|
| + * builder that were added after its constructor. |
| * |
| - * TODO: We'd prefer for the ARE to just save and restore the GP. However, this would add |
| - * significant complexity to the multi-ref architecture for deferred drawing. Once GrDrawState |
| - * and GrOptDrawState are fully separated then GrDrawState will never be in the deferred |
| - * execution state and GrOptDrawState always will be (and will be immutable and therefore |
| - * unable to have an ARE). At this point we can restore sanity and have the ARE save and restore |
| - * the GP. |
| + * This class has strange behavior around geometry processor. If there is a GP on the pipeline |
| + * builder it will assert that the GP is not modified until after the destructor of the ARE. If |
| + * the pipeline builder has a NULL GP when the ARE is constructed then it will reset it to null |
| + * in the destructor. |
| */ |
| class AutoRestoreEffects : public ::SkNoncopyable { |
| public: |
| AutoRestoreEffects() |
| - : fDrawState(NULL) |
| + : fPipelineBuilder(NULL) |
| , fColorEffectCnt(0) |
| , fCoverageEffectCnt(0) {} |
| - AutoRestoreEffects(GrDrawState* ds) |
| - : fDrawState(NULL) |
| + AutoRestoreEffects(GrPipelineBuilder* ds) |
| + : fPipelineBuilder(NULL) |
| , fColorEffectCnt(0) |
| , fCoverageEffectCnt(0) { |
| this->set(ds); |
| @@ -202,12 +196,12 @@ public: |
| ~AutoRestoreEffects() { this->set(NULL); } |
| - void set(GrDrawState* ds); |
| + void set(GrPipelineBuilder* ds); |
| - bool isSet() const { return SkToBool(fDrawState); } |
| + bool isSet() const { return SkToBool(fPipelineBuilder); } |
| private: |
| - GrDrawState* fDrawState; |
| + GrPipelineBuilder* fPipelineBuilder; |
| int fColorEffectCnt; |
| int fCoverageEffectCnt; |
| }; |
| @@ -219,27 +213,27 @@ public: |
| */ |
| class AutoRestoreStencil : public ::SkNoncopyable { |
| public: |
| - AutoRestoreStencil() : fDrawState(NULL) {} |
| + AutoRestoreStencil() : fPipelineBuilder(NULL) {} |
| - AutoRestoreStencil(GrDrawState* ds) : fDrawState(NULL) { this->set(ds); } |
| + AutoRestoreStencil(GrPipelineBuilder* ds) : fPipelineBuilder(NULL) { this->set(ds); } |
| ~AutoRestoreStencil() { this->set(NULL); } |
| - void set(GrDrawState* ds) { |
| - if (fDrawState) { |
| - fDrawState->setStencil(fStencilSettings); |
| + void set(GrPipelineBuilder* ds) { |
| + if (fPipelineBuilder) { |
| + fPipelineBuilder->setStencil(fStencilSettings); |
| } |
| - fDrawState = ds; |
| + fPipelineBuilder = ds; |
| if (ds) { |
| fStencilSettings = ds->getStencil(); |
| } |
| } |
| - bool isSet() const { return SkToBool(fDrawState); } |
| + bool isSet() const { return SkToBool(fPipelineBuilder); } |
| private: |
| - GrDrawState* fDrawState; |
| - GrStencilSettings fStencilSettings; |
| + GrPipelineBuilder* fPipelineBuilder; |
| + GrStencilSettings fStencilSettings; |
| }; |
| /// @} |
| @@ -397,7 +391,7 @@ public: |
| /////////////////////////////////////////////////////////////////////////// |
| - GrDrawState& operator= (const GrDrawState& that); |
| + GrPipelineBuilder& operator= (const GrPipelineBuilder& that); |
| private: |
| const GrProcOptInfo& colorProcInfo(const GrPrimitiveProcessor* pp) const { |
| @@ -457,7 +451,7 @@ private: |
| mutable const GrPrimitiveProcessor* fColorPrimProc; |
| mutable const GrPrimitiveProcessor* fCoveragePrimProc; |
| - friend class GrOptDrawState; |
| + friend class GrPipeline; |
| }; |
| #endif |