diff options
| author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-08-25 19:15:31 +0000 |
|---|---|---|
| committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-08-25 19:15:31 +0000 |
| commit | c64599649bab68aedf07959f86fa506fc46fa3c2 (patch) | |
| tree | 553720d35a214cc889dfd8f4e67dc640cc760c5e /samplecode/SampleDitherBitmap.cpp | |
| parent | 593847a0e063522bef780ebac4f4072cf4cae6d8 (diff) | |
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
Diffstat (limited to 'samplecode/SampleDitherBitmap.cpp')
| -rw-r--r-- | samplecode/SampleDitherBitmap.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/samplecode/SampleDitherBitmap.cpp b/samplecode/SampleDitherBitmap.cpp index 35816a213a..e859cdaf44 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 @@ class DitherBitmapView : public SkView { SkBitmap fBM32; public: DitherBitmapView() { + test_pathregion(); fBM8 = make_bitmap(); fBM8.copyTo(&fBM32, SkBitmap::kARGB_8888_Config); } |
