aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-19 15:45:48 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-21 11:41:17 +0000
commitd34edf3dc902532f88842f35375c474f94f82d83 (patch)
tree06a38d69c351e6675467daeafc1439124561cbd0 /include
parent76149aa5fba375ebedab3d0422e0677e0bb102a7 (diff)
Revert "Revert "Remove GrSurfaceDesc member from GrSurface.""
This reverts commit 4b30a96a3e96b7f051e25025f4f17f3c54e04153. Bug: skia: Change-Id: I14d5b402c87df8fffbc29f16686fcfa18474fc48 Reviewed-on: https://skia-review.googlesource.com/17408 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrRenderTarget.h9
-rw-r--r--include/gpu/GrSurface.h25
-rw-r--r--include/gpu/GrTexture.h3
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;