diff options
author | 2017-05-18 18:13:40 +0000 | |
---|---|---|
committer | 2017-05-18 18:13:48 +0000 | |
commit | 4b30a96a3e96b7f051e25025f4f17f3c54e04153 (patch) | |
tree | 72e0561a19df0db0ca111ee58e4730b2068adb28 /include | |
parent | 14d54c207d7a175d14d34f5527af7cbfd579f4d5 (diff) |
Revert "Remove GrSurfaceDesc member from GrSurface."
This reverts commit 84911546b9535a2fff6c5e07f588f175d5a04f45.
Reason for revert: Breaking bots possibly?
Original change's description:
> Remove GrSurfaceDesc member from GrSurface.
>
> Change-Id: I0fe979994e1e3fc457b952dfb5e0090c45fad771
> Reviewed-on: https://skia-review.googlesource.com/17273
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
>
TBR=bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I404e509fcd3e3d5527b3bc6e286b7d436c12e879
Reviewed-on: https://skia-review.googlesource.com/17364
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrRenderTarget.h | 9 | ||||
-rw-r--r-- | include/gpu/GrSurface.h | 25 | ||||
-rw-r--r-- | include/gpu/GrTexture.h | 3 |
3 files changed, 17 insertions, 20 deletions
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h index bd25f4fc0e..fdf6f9cddc 100644 --- a/include/gpu/GrRenderTarget.h +++ b/include/gpu/GrRenderTarget.h @@ -30,10 +30,10 @@ public: const GrRenderTarget* asRenderTarget() const override { return this; } // GrRenderTarget - bool isStencilBufferMultisampled() const { return fSampleCnt > 0; } + bool isStencilBufferMultisampled() const { return fDesc.fSampleCnt > 0; } GrFSAAType fsaaType() const { - if (!fSampleCnt) { + if (!fDesc.fSampleCnt) { SkASSERT(!(fFlags & Flags::kMixedSampled)); return GrFSAAType::kNone; } @@ -44,13 +44,13 @@ public: /** * Returns the number of samples/pixel in the stencil buffer (Zero if non-MSAA). */ - int numStencilSamples() const { return fSampleCnt; } + int numStencilSamples() const { return fDesc.fSampleCnt; } /** * Returns the number of samples/pixel in the color buffer (Zero if non-MSAA or mixed sampled). */ int numColorSamples() const { - return GrFSAAType::kMixedSamples == this->fsaaType() ? 0 : fSampleCnt; + return GrFSAAType::kMixedSamples == this->fsaaType() ? 0 : fDesc.fSampleCnt; } /** @@ -135,7 +135,6 @@ private: friend class GrRenderTargetPriv; friend class GrRenderTargetProxy; // for Flags - int fSampleCnt; GrStencilAttachment* fStencilAttachment; uint8_t fMultisampleSpecsID; Flags fFlags; diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h index 4caa842b4a..6626765d6a 100644 --- a/include/gpu/GrSurface.h +++ b/include/gpu/GrSurface.h @@ -23,12 +23,12 @@ public: /** * Retrieves the width of the surface. */ - int width() const { return fWidth; } + int width() const { return fDesc.fWidth; } /** * Retrieves the height of the surface. */ - int height() const { return fHeight; } + int height() const { return fDesc.fHeight; } /** * Helper that gets the width and height of the surface as a bounding rectangle. @@ -36,8 +36,9 @@ public: SkRect getBoundsRect() const { return SkRect::MakeIWH(this->width(), this->height()); } GrSurfaceOrigin origin() const { - SkASSERT(kTopLeft_GrSurfaceOrigin == fOrigin || kBottomLeft_GrSurfaceOrigin == fOrigin); - return fOrigin; + SkASSERT(kTopLeft_GrSurfaceOrigin == fDesc.fOrigin || + kBottomLeft_GrSurfaceOrigin == fDesc.fOrigin); + return fDesc.fOrigin; } /** @@ -46,7 +47,7 @@ public: * if client asked us to render to a target that has a pixel * config that isn't equivalent with one of our configs. */ - GrPixelConfig config() const { return fConfig; } + GrPixelConfig config() const { return fDesc.fConfig; } /** * @return the texture associated with the surface, may be null. @@ -78,23 +79,17 @@ protected: friend class GrSurfacePriv; GrSurface(GrGpu* gpu, const GrSurfaceDesc& desc) - : INHERITED(gpu) - , fConfig(desc.fConfig) - , fWidth(desc.fWidth) - , fHeight(desc.fHeight) - , fOrigin(desc.fOrigin) {} + : INHERITED(gpu) + , fDesc(desc) { + } ~GrSurface() override {} + GrSurfaceDesc fDesc; void onRelease() override; void onAbandon() override; private: - GrPixelConfig fConfig; - int fWidth; - int fHeight; - GrSurfaceOrigin fOrigin; - typedef GrGpuResource INHERITED; }; diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h index a7adc05d0c..0edcbd0e13 100644 --- a/include/gpu/GrTexture.h +++ b/include/gpu/GrTexture.h @@ -36,6 +36,7 @@ public: #ifdef SK_DEBUG void validate() const { this->INHERITED::validate(); + this->validateDesc(); } #endif @@ -53,6 +54,8 @@ protected: GrTexture(GrGpu*, const GrSurfaceDesc&, GrSLType samplerType, GrSamplerParams::FilterMode highestFilterMode, bool wasMipMapDataProvided); + void validateDesc() const; + private: void computeScratchKey(GrScratchKey*) const override; size_t onGpuMemorySize() const override; |