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

Unified Diff: src/gpu/GrDrawingManager.cpp

Issue 2324473002: Move prepareForExternalIO implementation from GrContext to GrDrawingManager (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « src/gpu/GrDrawingManager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawingManager.cpp
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 4642e1a3fe5e491d54856c9bdf1313060482701b..e8cea756228c210e204ac95bca011071c94a6dfc 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -13,6 +13,7 @@
#include "GrPathRenderingDrawContext.h"
#include "GrResourceProvider.h"
#include "GrSoftwarePathRenderer.h"
+#include "GrSurfacePriv.h"
#include "SkSurface_Gpu.h"
#include "SkTTopoSort.h"
@@ -135,6 +136,23 @@ void GrDrawingManager::internalFlush(GrResourceCache::FlushType type) {
fFlushing = false;
}
+void GrDrawingManager::prepareSurfaceForExternalIO(GrSurface* surface) {
+ if (this->wasAbandoned()) {
+ return;
+ }
+ SkASSERT(surface);
+ SkASSERT(surface->getContext() == fContext);
+
+ if (surface->surfacePriv().hasPendingIO()) {
+ this->flush();
+ }
+
+ GrRenderTarget* rt = surface->asRenderTarget();
+ if (fContext->getGpu() && rt) {
+ fContext->getGpu()->resolveRenderTarget(rt);
+ }
+}
+
GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) {
SkASSERT(fContext);
« no previous file with comments | « src/gpu/GrDrawingManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698