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

Unified Diff: tools/VisualBench/WrappedBenchmark.h

Issue 1897863008: Hide SkCanvas::LayerIter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix debug build 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/CanvasTest.cpp ('k') | no next file » | 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 bd88f13502ead965cb79cc2a0c182c639a59fd22..ddf601ddf8331ed80a1b32eccaeafa2d7f43dd05 100644
--- a/tools/VisualBench/WrappedBenchmark.h
+++ b/tools/VisualBench/WrappedBenchmark.h
@@ -9,7 +9,6 @@
#define WrappedBenchmark_DEFINED
#include "Benchmark.h"
-#include "SkDevice.h"
#include "SkSurface.h"
#include "GrContext.h"
#include "GrRenderTarget.h"
@@ -113,26 +112,15 @@ 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, *src;
+ GrRenderTarget* dst = canvas->internal_private_accessTopLayerRenderTarget();
+ SkASSERT(dst);
- SkCanvas::LayerIter canvasIter(canvas, false);
- SkAssertResult((dst = canvasIter.device()->accessRenderTarget()));
-
- SkCanvas::LayerIter offscreenIter(fOffScreen->getCanvas(), false);
- SkAssertResult((src = offscreenIter.device()->accessRenderTarget()));
+ GrRenderTarget* src = fOffScreen->getCanvas()->internal_private_accessTopLayerRenderTarget();
+ SkASSERT(src);
SkASSERT(dst->getContext() == src->getContext());
dst->getContext()->copySurface(dst, src, SkIRect::MakeWH(w, h), SkIPoint::Make(0, 0));
-
-#ifdef SK_DEBUG
- // This method should not be called while layers are saved.
- canvasIter.next();
- SkASSERT(canvasIter.done());
-
- offscreenIter.next();
- SkASSERT(offscreenIter.done());
-#endif
}
int fNumSamples;
« no previous file with comments | « tests/CanvasTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698