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

Unified Diff: src/gpu/batches/GrCopySurfaceBatch.h

Issue 2078483002: Start using GrGpuCommandBuffer in GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@memoryWAR
Patch Set: clean up Created 4 years, 6 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/batches/GrCopySurfaceBatch.h
diff --git a/src/gpu/batches/GrCopySurfaceBatch.h b/src/gpu/batches/GrCopySurfaceBatch.h
index 3926643f8aedff441e2c36aece565a267c3d9ba8..d0269b79bf8c795494f551edf39d0b21e91bcd4d 100644
--- a/src/gpu/batches/GrCopySurfaceBatch.h
+++ b/src/gpu/batches/GrCopySurfaceBatch.h
@@ -36,7 +36,7 @@ public:
GrRenderTarget* rt = fDst.get()->asRenderTarget();
return rt ? rt->getUniqueID() : 0;
}
- GrRenderTarget* renderTarget() const override { return fDst.get()->asRenderTarget(); }
+ GrRenderTarget* renderTarget() const override { return nullptr; }
jvanverth1 2016/06/17 15:25:16 It's not clear to me why this is okay.
egdaniel 2016/06/17 15:57:35 Before my change, this call was only called by dra
jvanverth1 2016/06/17 16:49:13 Just so I understand: so if renderTarget() returns
egdaniel 2016/06/17 17:06:49 Yes
SkString dumpInfo() const override {
SkString string;
@@ -63,8 +63,13 @@ private:
void onPrepare(GrBatchFlushState*) override {}
- void onDraw(GrBatchFlushState* state) override {
- state->gpu()->copySurface(fDst.get(), fSrc.get(), fSrcRect, fDstPoint);
+ void onDraw(GrBatchFlushState* state, GrGpuCommandBuffer* buffer) override {
+ if (!buffer) {
+ state->gpu()->copySurface(fDst.get(), fSrc.get(), fSrcRect, fDstPoint);
+ } else {
+ // currently we are not sending copies through the GrGpuCommandBuffer
jvanverth1 2016/06/17 15:25:16 Does this mean that copies will be performed immed
egdaniel 2016/06/17 15:57:35 Yes it is safe. Since the renderTarget above retur
jvanverth1 2016/06/17 16:49:13 Acknowledged.
+ SkASSERT(false);
+ }
}
GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst;

Powered by Google App Engine
This is Rietveld 408576698