Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: include/gpu/GrDrawContext.h

Issue 2163323002: Add desired width & height to drawContext (as opposed to using the width & height of the RT) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More Clean up Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkSpecialSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrDrawContext.h
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 1a7580ea03947db7fb84de27f06545f1fe12fbb2..9e71165fed0b1e1e45ca49da8ce90d5c92113d04 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -264,8 +264,8 @@ public:
}
const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); }
- int width() const { return fRenderTarget->width(); }
- int height() const { return fRenderTarget->height(); }
+ int width() const { return fWidth; }
+ int height() const { return fHeight; }
GrPixelConfig config() const { return fRenderTarget->config(); }
int numColorSamples() const { return fRenderTarget->numColorSamples(); }
bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); }
@@ -286,7 +286,7 @@ public:
GrAuditTrail* auditTrail() { return fAuditTrail; }
protected:
- GrDrawContext(GrContext*, GrDrawingManager*, sk_sp<GrRenderTarget>,
+ GrDrawContext(GrContext*, GrDrawingManager*, int width, int height, sk_sp<GrRenderTarget>,
const SkSurfaceProps* surfaceProps, GrAuditTrail*, GrSingleOwner*);
GrDrawingManager* drawingManager() { return fDrawingManager; }
@@ -350,6 +350,11 @@ private:
GrDrawTarget* getDrawTarget();
GrDrawingManager* fDrawingManager;
+
+ // The width & height of the drawContext may be less than the width & height of the
+ // underlying renderTarget
+ int fWidth;
+ int fHeight;
sk_sp<GrRenderTarget> fRenderTarget;
// In MDB-mode the drawTarget can be closed by some other drawContext that has picked
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkSpecialSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698