diff options
author | robertphillips <robertphillips@google.com> | 2016-07-26 11:38:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-26 11:38:17 -0700 |
commit | 7e922765545f42ce691e4f3d5fbbd4e44ba47ff1 (patch) | |
tree | 40f15d00e25acaf015f46e45d11d1858eb3b8cf6 /src/image | |
parent | 3a0dbde1cfa84b08c7dd5b597142e9f6179f2d07 (diff) |
Reduce usage of MakeRenderTargetDirect
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2187573002
Review-Url: https://codereview.chromium.org/2187573002
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/SkSurface.cpp | 4 | ||||
-rw-r--r-- | src/image/SkSurface_Gpu.cpp | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp index 2035e4cc8a..73b8286082 100644 --- a/src/image/SkSurface.cpp +++ b/src/image/SkSurface.cpp @@ -228,8 +228,8 @@ sk_sp<SkSurface> SkSurface::MakeRenderTargetDirect(GrRenderTarget*, sk_sp<SkColo return nullptr; } -sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext*, SkBudgeted, const SkImageInfo&, int, - const SkSurfaceProps*) { +sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext*, SkBudgeted, const SkImageInfo&, + int, GrSurfaceOrigin, const SkSurfaceProps*) { return nullptr; } diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp index ef8dd5f06e..d8b4cee2dc 100644 --- a/src/image/SkSurface_Gpu.cpp +++ b/src/image/SkSurface_Gpu.cpp @@ -67,10 +67,11 @@ SkCanvas* SkSurface_Gpu::onNewCanvas() { sk_sp<SkSurface> SkSurface_Gpu::onNewSurface(const SkImageInfo& info) { int sampleCount = fDevice->accessDrawContext()->numColorSamples(); + GrSurfaceOrigin origin = fDevice->accessDrawContext()->origin(); // TODO: Make caller specify this (change virtual signature of onNewSurface). static const SkBudgeted kBudgeted = SkBudgeted::kNo; return SkSurface::MakeRenderTarget(fDevice->context(), kBudgeted, info, sampleCount, - &this->props()); + origin, &this->props()); } sk_sp<SkImage> SkSurface_Gpu::onNewImageSnapshot(SkBudgeted budgeted, ForceCopyMode forceCopyMode) { @@ -145,9 +146,9 @@ sk_sp<SkSurface> SkSurface::MakeRenderTargetDirect(GrRenderTarget* target, sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext* ctx, SkBudgeted budgeted, const SkImageInfo& info, int sampleCount, - const SkSurfaceProps* props) { + GrSurfaceOrigin origin, const SkSurfaceProps* props) { sk_sp<SkGpuDevice> device(SkGpuDevice::Make( - ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitContents)); + ctx, budgeted, info, sampleCount, origin, props, SkGpuDevice::kClear_InitContents)); if (!device) { return nullptr; } |