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

Unified Diff: samplecode/SampleDitherBitmap.cpp

Issue 132513003: SampleApp Cleanup (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final rebase Created 6 years, 11 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 | « samplecode/SampleApp.cpp ('k') | samplecode/SampleEncode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleDitherBitmap.cpp
diff --git a/samplecode/SampleDitherBitmap.cpp b/samplecode/SampleDitherBitmap.cpp
index 9132ceb1953d9ac3479aa7a2b4f033d4104bd8af..dc439002d0c8d853d419dafffb49f23ba35bad2f 100644
--- a/samplecode/SampleDitherBitmap.cpp
+++ b/samplecode/SampleDitherBitmap.cpp
@@ -37,7 +37,7 @@ static void draw_gradient(SkCanvas* canvas) {
draw_rect(canvas, r, p);
}
-static void test_pathregion() {
+static bool test_pathregion() {
SkPath path;
SkRegion region;
path.moveTo(25071800.f, -141823808.f);
@@ -49,8 +49,7 @@ static void test_pathregion() {
SkIRect bounds;
path.getBounds().round(&bounds);
SkRegion clip(bounds);
- bool result = region.setPath(path, clip); // <-- !! DOWN !!
- SkDebugf("----- result %d\n", result);
+ return region.setPath(path, clip); // <-- !! DOWN !!
}
static SkBitmap make_bitmap() {
@@ -79,9 +78,10 @@ static SkBitmap make_bitmap() {
class DitherBitmapView : public SampleView {
SkBitmap fBM8;
SkBitmap fBM32;
+ bool fResult;
public:
DitherBitmapView() {
- test_pathregion();
+ fResult = test_pathregion();
fBM8 = make_bitmap();
fBM8.copyTo(&fBM32, SkBitmap::kARGB_8888_Config);
@@ -138,6 +138,14 @@ protected:
canvas->translate(0, SkIntToScalar(fBM8.height() *3));
draw_gradient(canvas);
+
+ char resultTrue[] = "SkRegion::setPath returned true";
+ char resultFalse[] = "SkRegion::setPath returned false";
+ SkPaint p;
+ if (fResult)
+ canvas->drawText(resultTrue, sizeof(resultTrue) - 1, 0, 50, p);
+ else
+ canvas->drawText(resultFalse, sizeof(resultFalse) - 1, 0, 50, p);
}
private:
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleEncode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698