special case 1x1 bitmaps when drawn as a shader (treat as a solid color)
git-svn-id: http://skia.googlecode.com/svn/trunk@336 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleDitherBitmap.cpp b/samplecode/SampleDitherBitmap.cpp
index 35816a2..e859cda 100644
--- a/samplecode/SampleDitherBitmap.cpp
+++ b/samplecode/SampleDitherBitmap.cpp
@@ -4,6 +4,22 @@
#include "SkCanvas.h"
#include "SkUtils.h"
+static void test_pathregion() {
+ SkPath path;
+ SkRegion region;
+ path.moveTo(25071800.f, -141823808.f);
+ path.lineTo(25075500.f, -141824000.f);
+ path.lineTo(25075400.f, -141827712.f);
+ path.lineTo(25071810.f, -141827600.f);
+ path.close();
+
+ SkIRect bounds;
+ path.getBounds().round(&bounds);
+ SkRegion clip(bounds);
+ bool result = region.setPath(path, clip); // <-- !! DOWN !!
+ SkDebugf("----- result %d\n", result);
+}
+
static SkBitmap make_bitmap() {
SkBitmap bm;
SkColorTable* ctable = new SkColorTable(256);
@@ -33,6 +49,7 @@
SkBitmap fBM32;
public:
DitherBitmapView() {
+ test_pathregion();
fBM8 = make_bitmap();
fBM8.copyTo(&fBM32, SkBitmap::kARGB_8888_Config);
}