diff options
author | 2016-04-28 09:55:15 -0700 | |
---|---|---|
committer | 2016-04-28 09:55:15 -0700 | |
commit | d4c741e3d0e0fa633399691c47f76b6c7841ee83 (patch) | |
tree | 3a242889fa24e3e209df4e0ec76049fbdde61721 /include/gpu | |
parent | 23bd7e9273438863149ed58c089e9bf457e9892d (diff) |
Refactor drawContext/RenderTarget creation
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1914883002
Committed: https://skia.googlesource.com/skia/+/2f1c42e8448bbbadeb3df1c626faa90aa33f8907
Review-Url: https://codereview.chromium.org/1914883002
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrContext.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 087d821beb..cb407aa5bf 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -194,6 +194,21 @@ public: */ sk_sp<GrDrawContext> drawContext(sk_sp<GrRenderTarget> rt, const SkSurfaceProps* = nullptr); + enum BackingFit { + kTight_BackingFit, + kLoose_BackingFit + }; + + /** + * Create both a GrRenderTarget and a matching GrDrawContext to wrap it. + * The created GrRenderTarget will always be budgeted. + */ + sk_sp<GrDrawContext> newDrawContext(BackingFit fit, + int width, int height, + GrPixelConfig config, + int sampleCnt = 0, + GrSurfaceOrigin origin = kDefault_GrSurfaceOrigin); + /////////////////////////////////////////////////////////////////////////// // Misc. |