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

Unified Diff: tools/VisualBench/WrappedBenchmark.h

Issue 1930623003: Clean up test drawContext usage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix typo Created 4 years, 8 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 | « tests/SurfaceTest.cpp ('k') | tools/debugger/SkDebugCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/WrappedBenchmark.h
diff --git a/tools/VisualBench/WrappedBenchmark.h b/tools/VisualBench/WrappedBenchmark.h
index ddf601ddf8331ed80a1b32eccaeafa2d7f43dd05..8939fda319b984b52dc0e34aefd99214ac23112b 100644
--- a/tools/VisualBench/WrappedBenchmark.h
+++ b/tools/VisualBench/WrappedBenchmark.h
@@ -11,6 +11,7 @@
#include "Benchmark.h"
#include "SkSurface.h"
#include "GrContext.h"
+#include "GrDrawContext.h"
#include "GrRenderTarget.h"
// Wrap some other benchmark to allow specialization to either
@@ -112,15 +113,18 @@ private:
void onBlitToScreen(SkCanvas* canvas, int w, int h) override {
// We call copySurface directly on the underlying GPU surfaces for a more efficient blit.
- GrRenderTarget* dst = canvas->internal_private_accessTopLayerRenderTarget();
- SkASSERT(dst);
+ GrDrawContext* dstDC = canvas->internal_private_accessTopLayerDrawContext();
+ SkASSERT(dstDC);
- GrRenderTarget* src = fOffScreen->getCanvas()->internal_private_accessTopLayerRenderTarget();
+ GrDrawContext* srcDC =
+ fOffScreen->getCanvas()->internal_private_accessTopLayerDrawContext();
+ SkASSERT(srcDC);
+ GrRenderTarget* src = srcDC->accessRenderTarget();
SkASSERT(src);
- SkASSERT(dst->getContext() == src->getContext());
+ SkASSERT(canvas->getGrContext() == fOffScreen->getCanvas()->getGrContext());
- dst->getContext()->copySurface(dst, src, SkIRect::MakeWH(w, h), SkIPoint::Make(0, 0));
+ dstDC->copySurface(src, SkIRect::MakeWH(w, h), SkIPoint::Make(0, 0));
}
int fNumSamples;
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | tools/debugger/SkDebugCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698