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

Unified Diff: samplecode/SampleLayers.cpp

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 | « include/core/SkCanvas.h ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleLayers.cpp
diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp
index 194f0a70a92505882f01beab8633c8cf0a5c9cf7..43869762e723c21145a5c5c277281a42b8ab190b 100644
--- a/samplecode/SampleLayers.cpp
+++ b/samplecode/SampleLayers.cpp
@@ -12,7 +12,6 @@
#include "SkCamera.h"
#include "SkColorFilter.h"
#include "SkColorPriv.h"
-#include "SkDevice.h"
#include "SkGradientShader.h"
#include "SkImage.h"
#include "SkInterpolator.h"
@@ -35,22 +34,6 @@ static void make_paint(SkPaint* paint, const SkMatrix& localMatrix) {
paint->setXfermodeMode(SkXfermode::kDstIn_Mode);
}
-static void dump_layers(const char label[], SkCanvas* canvas) {
- SkDebugf("Dump Layers(%s)\n", label);
-
- SkCanvas::LayerIter iter(canvas, true);
- int index = 0;
- while (!iter.done()) {
- SkImageInfo info = iter.device()->imageInfo();
- const SkIRect& clip = iter.clip().getBounds();
- SkDebugf("Layer[%d] bitmap [%d %d] X=%d Y=%d clip=[%d %d %d %d] alpha=%d\n", index++,
- info.width(), info.height(), iter.x(), iter.y(),
- clip.fLeft, clip.fTop, clip.fRight, clip.fBottom,
- iter.paint().getAlpha());
- iter.next();
- }
-}
-
// test drawing with strips of fading gradient above and below
static void test_fade(SkCanvas* canvas) {
SkAutoCanvasRestore ar(canvas, true);
@@ -86,8 +69,6 @@ static void test_fade(SkCanvas* canvas) {
p.setAntiAlias(true);
canvas->drawOval(r, p);
- dump_layers("inside layer alpha", canvas);
-
canvas->restore();
} else {
r.set(0, 0, SkIntToScalar(100), SkIntToScalar(100));
@@ -100,8 +81,6 @@ static void test_fade(SkCanvas* canvas) {
// return;
- dump_layers("outside layer alpha", canvas);
-
// now apply an effect
SkMatrix m;
m.setScale(SK_Scalar1, -SK_Scalar1);
« no previous file with comments | « include/core/SkCanvas.h ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698