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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 2176333002: Remove SkSurface::MakeRenderTargetDirect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 4 years, 4 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
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index ab4b319ed08a7d151fe1f5494554acccb6b78067..b1c6407d2fe821bd5236536aab0db97809e630d6 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) {
« src/gpu/SkGpuDevice.h ('K') | « src/gpu/SkGpuDevice.h ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698