aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrSurface.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gpu/GrSurface.h')
-rw-r--r--include/gpu/GrSurface.h25
1 files changed, 15 insertions, 10 deletions
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;
};