diff options
author | 2016-08-04 08:45:02 -0700 | |
---|---|---|
committer | 2016-08-04 08:45:02 -0700 | |
commit | 15c42ca310e8b9785eab38b3dd36265948e85b0e (patch) | |
tree | c046b23f6c72377c28fdbd451bf2c997f799cc31 /src/gpu/SkGpuDevice.cpp | |
parent | b83cdbcbb0829bf6e0c9cb2c7d9a0ff460f7f431 (diff) |
Remove SkSurface::MakeRenderTargetDirect
split into:
https://codereview.chromium.org/2182543003/ (Move prepareForExternalIO from GrRenderTarget to GrDrawContext)
https://codereview.chromium.org/2187573002/ (Reduce usage of MakeRenderTargetDirect)
https://codereview.chromium.org/2186073002/ (Rename GrContext's newDrawContext & drawContext to makeDrawContext)
https://codereview.chromium.org/2178353005/ (Remove use of MakeRenderTargetDirect from view system)
https://codereview.chromium.org/2198433003/ (Remove some ancillary users of SkSurface::MakeRenderTargetDirect)
https://codereview.chromium.org/2208483004/ (Remove GrRenderTarget member variable from SkGpuDevice)
https://codereview.chromium.org/2211473002/ (Move GrContext::makeDrawContext to new GrContextPriv object)
TBR=bsalomon@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2176333002
Review-Url: https://codereview.chromium.org/2176333002
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index ab4b319ed0..b1c6407d2f 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -9,10 +9,8 @@ #include "GrBlurUtils.h" #include "GrContext.h" -#include "GrContextPriv.h" #include "GrDrawContextPriv.h" #include "GrGpu.h" -#include "GrGpuResourcePriv.h" #include "GrImageIDTextureAdjuster.h" #include "GrStyle.h" #include "GrTracing.h" @@ -92,31 +90,9 @@ bool SkGpuDevice::CheckAlphaTypeAndGetFlags( return true; } -sk_sp<SkGpuDevice> SkGpuDevice::Make(sk_sp<GrRenderTarget> rt, sk_sp<SkColorSpace> colorSpace, - const SkSurfaceProps* props, InitContents init) { - if (!rt || rt->wasDestroyed() || !rt->getContext()) { - return nullptr; - } - unsigned flags; - if (!CheckAlphaTypeAndGetFlags(nullptr, init, &flags)) { - return nullptr; - } - - const int width = rt->width(); - const int height = rt->height(); - - GrContext* context = rt->getContext(); - - sk_sp<GrDrawContext> drawContext(context->contextPriv().makeWrappedDrawContext( - std::move(rt), - std::move(colorSpace), - props)); - return sk_sp<SkGpuDevice>(new SkGpuDevice(std::move(drawContext), width, height, flags)); -} - -sk_sp<SkBaseDevice> SkGpuDevice::Make(sk_sp<GrDrawContext> drawContext, - int width, int height, - InitContents init) { +sk_sp<SkGpuDevice> SkGpuDevice::Make(sk_sp<GrDrawContext> drawContext, + int width, int height, + InitContents init) { if (!drawContext || drawContext->wasAbandoned()) { return nullptr; } @@ -124,7 +100,7 @@ sk_sp<SkBaseDevice> SkGpuDevice::Make(sk_sp<GrDrawContext> drawContext, if (!CheckAlphaTypeAndGetFlags(nullptr, init, &flags)) { return nullptr; } - return sk_sp<SkBaseDevice>(new SkGpuDevice(std::move(drawContext), width, height, flags)); + return sk_sp<SkGpuDevice>(new SkGpuDevice(std::move(drawContext), width, height, flags)); } sk_sp<SkGpuDevice> SkGpuDevice::Make(GrContext* context, SkBudgeted budgeted, @@ -248,9 +224,8 @@ bool SkGpuDevice::onWritePixels(const SkImageInfo& info, const void* pixels, siz if (kUnpremul_SkAlphaType == info.alphaType()) { flags = GrContext::kUnpremul_PixelOpsFlag; } - fDrawContext->accessRenderTarget()->writePixels(x, y, info.width(), info.height(), - config, pixels, rowBytes, flags); - return true; + return fDrawContext->accessRenderTarget()->writePixels(x, y, info.width(), info.height(), + config, pixels, rowBytes, flags); } bool SkGpuDevice::onAccessPixels(SkPixmap* pmap) { |