diff options
Diffstat (limited to 'include/gpu')
-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, 20 insertions, 17 deletions
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h index fdf6f9cddc..bd25f4fc0e 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 fDesc.fSampleCnt > 0; } + bool isStencilBufferMultisampled() const { return fSampleCnt > 0; } GrFSAAType fsaaType() const { - if (!fDesc.fSampleCnt) { + if (!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 fDesc.fSampleCnt; } + int numStencilSamples() const { return 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 : fDesc.fSampleCnt; + return GrFSAAType::kMixedSamples == this->fsaaType() ? 0 : fSampleCnt; } /** @@ -135,6 +135,7 @@ 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 6626765d6a..4caa842b4a 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 fDesc.fWidth; } + int width() const { return fWidth; } /** * Retrieves the height of the surface. */ - int height() const { return fDesc.fHeight; } + int height() const { return fHeight; } /** * Helper that gets the width and height of the surface as a bounding rectangle. @@ -36,9 +36,8 @@ public: SkRect getBoundsRect() const { return SkRect::MakeIWH(this->width(), this->height()); } GrSurfaceOrigin origin() const { - SkASSERT(kTopLeft_GrSurfaceOrigin == fDesc.fOrigin || - kBottomLeft_GrSurfaceOrigin == fDesc.fOrigin); - return fDesc.fOrigin; + SkASSERT(kTopLeft_GrSurfaceOrigin == fOrigin || kBottomLeft_GrSurfaceOrigin == fOrigin); + return fOrigin; } /** @@ -47,7 +46,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 fDesc.fConfig; } + GrPixelConfig config() const { return fConfig; } /** * @return the texture associated with the surface, may be null. @@ -79,17 +78,23 @@ protected: friend class GrSurfacePriv; GrSurface(GrGpu* gpu, const GrSurfaceDesc& desc) - : INHERITED(gpu) - , fDesc(desc) { - } + : INHERITED(gpu) + , fConfig(desc.fConfig) + , fWidth(desc.fWidth) + , fHeight(desc.fHeight) + , fOrigin(desc.fOrigin) {} ~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 0edcbd0e13..a7adc05d0c 100644 --- a/include/gpu/GrTexture.h +++ b/include/gpu/GrTexture.h @@ -36,7 +36,6 @@ public: #ifdef SK_DEBUG void validate() const { this->INHERITED::validate(); - this->validateDesc(); } #endif @@ -54,8 +53,6 @@ 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; |