aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-15 08:01:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-15 12:55:06 +0000
commit38eb740b945626d45bcd44a9fd69573955205b68 (patch)
treea4b99fdd2b3f2663bd579799228400a12b3a5507
parent0fe4ed8598e76c7813adfeee2242b0564b06a3f2 (diff)
Remove SK_RASTER_RECORDER_IMPLEMENTATION
TBR=bsalomon@google.com Change-Id: I9608ce5ce2b9d38c5e356d8428a8ff05df6ccda7 Reviewed-on: https://skia-review.googlesource.com/114490 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
-rw-r--r--include/core/SkDeferredDisplayListRecorder.h2
-rw-r--r--include/core/SkSurfaceCharacterization.h4
-rw-r--r--include/private/SkDeferredDisplayList.h20
-rw-r--r--src/core/SkDeferredDisplayList.cpp11
-rw-r--r--src/core/SkDeferredDisplayListRecorder.cpp28
-rw-r--r--src/gpu/GrDrawingManager.cpp4
-rw-r--r--src/image/SkSurface_Gpu.cpp6
7 files changed, 2 insertions, 73 deletions
diff --git a/include/core/SkDeferredDisplayListRecorder.h b/include/core/SkDeferredDisplayListRecorder.h
index 497bb65248..048ce2b050 100644
--- a/include/core/SkDeferredDisplayListRecorder.h
+++ b/include/core/SkDeferredDisplayListRecorder.h
@@ -111,12 +111,10 @@ private:
const SkSurfaceCharacterization fCharacterization;
-#ifndef SK_RASTER_RECORDER_IMPLEMENTATION
#if SK_SUPPORT_GPU
sk_sp<GrContext> fContext;
#endif
sk_sp<SkDeferredDisplayList::LazyProxyData> fLazyProxyData;
-#endif
sk_sp<SkSurface> fSurface;
};
diff --git a/include/core/SkSurfaceCharacterization.h b/include/core/SkSurfaceCharacterization.h
index 9888c59164..8a2c4587ed 100644
--- a/include/core/SkSurfaceCharacterization.h
+++ b/include/core/SkSurfaceCharacterization.h
@@ -16,10 +16,6 @@
class SkColorSpace;
-// This define can be used to swap between the default (raster) DDL implementation and the
-// gpu implementation.
-//#define SK_RASTER_RECORDER_IMPLEMENTATION 1
-
#if SK_SUPPORT_GPU
#include "GrContext.h"
diff --git a/include/private/SkDeferredDisplayList.h b/include/private/SkDeferredDisplayList.h
index a3517bb6a0..4d379636a9 100644
--- a/include/private/SkDeferredDisplayList.h
+++ b/include/private/SkDeferredDisplayList.h
@@ -14,10 +14,6 @@
#include "GrOpList.h"
#endif
-#ifdef SK_RASTER_RECORDER_IMPLEMENTATION
-class SkImage; // DDL TODO: rm this since it is just for the temporary placeholder implementation
-#endif
-
class SkSurface;
/*
@@ -29,16 +25,6 @@ class SkSurface;
class SkDeferredDisplayList {
public:
-#ifdef SK_RASTER_RECORDER_IMPLEMENTATION
- SkDeferredDisplayList(const SkSurfaceCharacterization& characterization, sk_sp<SkImage> image)
- : fCharacterization(characterization)
- , fImage(std::move(image)) {
- }
-
- // DDL TODO: remove this. It is just scaffolding to get something up & running
- bool draw(SkSurface*) const;
-#endif
-
#if SK_SUPPORT_GPU
// This object is the source from which the lazy proxy backing the DDL will pull its backing
// texture when the DDL is replayed. It has to be separately ref counted bc the lazy proxy
@@ -67,16 +53,10 @@ private:
const SkSurfaceCharacterization fCharacterization;
-#ifdef SK_RASTER_RECORDER_IMPLEMENTATION
- sk_sp<SkImage> fImage;
-#else
-
#if SK_SUPPORT_GPU
SkTArray<sk_sp<GrOpList>> fOpLists;
#endif
sk_sp<LazyProxyData> fLazyProxyData;
-
-#endif
};
#endif
diff --git a/src/core/SkDeferredDisplayList.cpp b/src/core/SkDeferredDisplayList.cpp
index c4cf0686e6..530523a4b6 100644
--- a/src/core/SkDeferredDisplayList.cpp
+++ b/src/core/SkDeferredDisplayList.cpp
@@ -10,19 +10,8 @@
#include "SkCanvas.h"
#include "SkSurface.h"
-#ifndef SK_RASTER_RECORDER_IMPLEMENTATION
SkDeferredDisplayList::SkDeferredDisplayList(const SkSurfaceCharacterization& characterization,
sk_sp<LazyProxyData> lazyProxyData)
: fCharacterization(characterization)
, fLazyProxyData(std::move(lazyProxyData)) {
}
-#endif
-
-#ifdef SK_RASTER_RECORDER_IMPLEMENTATION
-// Placeholder. Ultimately, the SkSurface_Gpu will pass the wrapped opLists to its
-// renderTargetContext.
-bool SkDeferredDisplayList::draw(SkSurface* surface) const {
- surface->getCanvas()->drawImage(fImage.get(), 0, 0);
- return true;
-}
-#endif
diff --git a/src/core/SkDeferredDisplayListRecorder.cpp b/src/core/SkDeferredDisplayListRecorder.cpp
index 78bd35f493..cfb6c0063e 100644
--- a/src/core/SkDeferredDisplayListRecorder.cpp
+++ b/src/core/SkDeferredDisplayListRecorder.cpp
@@ -30,7 +30,7 @@ SkDeferredDisplayListRecorder::SkDeferredDisplayListRecorder(
}
SkDeferredDisplayListRecorder::~SkDeferredDisplayListRecorder() {
-#if SK_SUPPORT_GPU && !defined(SK_RASTER_RECORDER_IMPLEMENTATION)
+#if SK_SUPPORT_GPU
auto proxyProvider = fContext->contextPriv().proxyProvider();
// DDL TODO: Remove this. DDL contexts should allow for deletion while still having live
@@ -47,15 +47,6 @@ bool SkDeferredDisplayListRecorder::init() {
return false;
}
-#ifdef SK_RASTER_RECORDER_IMPLEMENTATION
- // Use raster right now to allow threading
- const SkImageInfo ii = SkImageInfo::Make(fCharacterization.width(), fCharacterization.height(),
- kN32_SkColorType, kOpaque_SkAlphaType,
- fCharacterization.refColorSpace());
-
- fSurface = SkSurface::MakeRaster(ii, &fCharacterization.surfaceProps());
- return SkToBool(fSurface.get());
-#else
SkASSERT(!fLazyProxyData);
#if SK_SUPPORT_GPU
@@ -113,8 +104,6 @@ bool SkDeferredDisplayListRecorder::init() {
#else
return false;
#endif
-
-#endif
}
SkCanvas* SkDeferredDisplayListRecorder::getCanvas() {
@@ -128,16 +117,6 @@ SkCanvas* SkDeferredDisplayListRecorder::getCanvas() {
}
std::unique_ptr<SkDeferredDisplayList> SkDeferredDisplayListRecorder::detach() {
-#ifdef SK_RASTER_RECORDER_IMPLEMENTATION
- sk_sp<SkImage> img = fSurface->makeImageSnapshot();
- fSurface.reset();
-
- // TODO: need to wrap the opLists associated with the deferred draws
- // in the SkDeferredDisplayList.
- return std::unique_ptr<SkDeferredDisplayList>(
- new SkDeferredDisplayList(fCharacterization, std::move(img)));
-#else
-
#if SK_SUPPORT_GPU
auto ddl = std::unique_ptr<SkDeferredDisplayList>(
new SkDeferredDisplayList(fCharacterization, std::move(fLazyProxyData)));
@@ -147,9 +126,6 @@ std::unique_ptr<SkDeferredDisplayList> SkDeferredDisplayListRecorder::detach() {
#else
return nullptr;
#endif
-
-#endif // SK_RASTER_RECORDER_IMPLEMENTATION
-
}
sk_sp<SkImage> SkDeferredDisplayListRecorder::makePromiseTexture(
@@ -164,7 +140,7 @@ sk_sp<SkImage> SkDeferredDisplayListRecorder::makePromiseTexture(
TextureFulfillProc textureFulfillProc,
TextureReleaseProc textureReleaseProc,
TextureContext textureContext) {
-#if !defined(SK_RASTER_RECORDER_IMPLEMENTATION) && SK_SUPPORT_GPU
+#if SK_SUPPORT_GPU
return SkImage_Gpu::MakePromiseTexture(fContext.get(),
backendFormat,
width,
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 63d1175930..d4f7888e3a 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -356,24 +356,20 @@ void GrDrawingManager::addOnFlushCallbackObject(GrOnFlushCallbackObject* onFlush
}
void GrDrawingManager::moveOpListsToDDL(SkDeferredDisplayList* ddl) {
-#ifndef SK_RASTER_RECORDER_IMPLEMENTATION
for (int i = 0; i < fOpLists.count(); ++i) {
// no opList should receive a new command after this
fOpLists[i]->makeClosed(*fContext->caps());
}
ddl->fOpLists = std::move(fOpLists);
-#endif
}
void GrDrawingManager::copyOpListsFromDDL(const SkDeferredDisplayList* ddl,
GrRenderTargetProxy* newDest) {
-#ifndef SK_RASTER_RECORDER_IMPLEMENTATION
// Here we jam the proxy that backs the current replay SkSurface into the LazyProxyData.
// The lazy proxy that references it (in the copied opLists) will steal its GrTexture.
ddl->fLazyProxyData->fReplayDest = newDest;
fOpLists.push_back_n(ddl->fOpLists.count(), ddl->fOpLists.begin());
-#endif
}
sk_sp<GrRenderTargetOpList> GrDrawingManager::newRTOpList(GrRenderTargetProxy* rtp,
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index a96131337f..527c35b16a 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -228,17 +228,11 @@ bool SkSurface_Gpu::onDraw(const SkDeferredDisplayList* ddl) {
return false;
}
-#ifdef SK_RASTER_RECORDER_IMPLEMENTATION
- // Ultimately need to pass opLists from the DeferredDisplayList on to the
- // SkGpuDevice's renderTargetContext.
- return ddl->draw(this);
-#else
GrRenderTargetContext* rtc = fDevice->accessRenderTargetContext();
GrContext* ctx = fDevice->context();
ctx->contextPriv().copyOpListsFromDDL(ddl, rtc->asRenderTargetProxy());
return true;
-#endif
}