diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-18 17:39:44 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-18 17:39:44 -0700 |
commit | af527e02dce280c269d751322e9f60aac8cb97da (patch) | |
tree | 19faf6d47cdd3d589a6dfcff0f8f75fcbb03aa20 | |
parent | 5956d1c224aadf1d2712b46b32d3fc69a19915bd (diff) | |
download | external_skia-af527e02dce280c269d751322e9f60aac8cb97da.zip external_skia-af527e02dce280c269d751322e9f60aac8cb97da.tar.gz external_skia-af527e02dce280c269d751322e9f60aac8cb97da.tar.bz2 |
auto import from //branches/cupcake_rel/...@140373
61 files changed, 1525 insertions, 9682 deletions
@@ -178,8 +178,13 @@ LOCAL_SRC_FILES:= \ src/utils/SkNinePatch.cpp \ src/utils/SkProxyCanvas.cpp +# these are for emoji support, needed by webkit +LOCAL_SRC_FILES += \ + emoji/EmojiFont.cpp + LOCAL_SHARED_LIBRARIES := \ libcutils \ + libemoji \ libutils \ libcorecg \ libexpat \ @@ -203,7 +208,8 @@ LOCAL_C_INCLUDES += \ external/libpng \ external/giflib \ external/expat/lib \ - external/jpeg + external/jpeg \ + frameworks/opt/emoji LOCAL_CFLAGS += -fpic -fstrict-aliasing diff --git a/emoji/EmojiFont.cpp b/emoji/EmojiFont.cpp new file mode 100644 index 0000000..3a794d0 --- /dev/null +++ b/emoji/EmojiFont.cpp @@ -0,0 +1,174 @@ +/* + * Copyright 2009, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "EmojiFactory.h" +#include "EmojiFont.h" +#include "SkCanvas.h" +#include "SkImageDecoder.h" +#include "SkPaint.h" +#include "SkTSearch.h" +#include "SkUtils.h" + +#include "gmoji_pua_table.h" + +namespace android { + +// lazily allocate the factory +static EmojiFactory* get_emoji_factory() { + static EmojiFactory* gEmojiFactory; + if (NULL == gEmojiFactory) { + gEmojiFactory = EmojiFactory::GetAvailableImplementation(); + // we may still be NULL, if there is no impl. + } + return gEmojiFactory; +} + +#define UNINITIALIZED_ENCODE_SIZE 0 // our array is initialzed with 0s +#define NOT_AVAILABLE_ENCODE_SIZE -1 // never a legal length for data + +struct EncodeDataRec { + SkBitmap* fBitmap; + const void* fData; + int fSize; +}; + +static EncodeDataRec gGmojiEncodeData[GMOJI_PUA_COUNT] = {}; + +/* Given a local index, return (initialized if needed) a rec containing the + encoded data and length. The bitmap field is initialized to 0, and is not + filled in by this routine per-se. + */ +static EncodeDataRec* get_encoderec(int index) { + if ((unsigned)index >= GMOJI_PUA_COUNT) { + SkDebugf("bad index passed to EncodeDataRec& get_encode_data %d\n", + index); + return NULL; + } + + // lazily fill in the data + EncodeDataRec* rec = &gGmojiEncodeData[index]; + + if (NOT_AVAILABLE_ENCODE_SIZE == rec->fSize) { + return NULL; + } + if (UNINITIALIZED_ENCODE_SIZE == rec->fSize) { + EmojiFactory* fact = get_emoji_factory(); + if (NULL == fact) { + return NULL; + } + + int32_t pua = GMOJI_PUA_MIN + gGmojiPUA[index]; + rec->fData = fact->GetImageBinaryFromAndroidPua(pua, &rec->fSize); + if (NULL == rec->fData) { + // flag this entry is not available, so we won't ask again + rec->fSize = NOT_AVAILABLE_ENCODE_SIZE; + return NULL; + } + } + return rec; +} + +/* Return the bitmap associated with the local index, or NULL if none is + available. Note that this will try to cache the bitmap the first time it + creates it. + */ +static const SkBitmap* get_bitmap(int index) { + EncodeDataRec* rec = get_encoderec(index); + SkBitmap* bitmap = NULL; + if (rec) { + bitmap = rec->fBitmap; + if (NULL == bitmap) { + bitmap = new SkBitmap; + if (!SkImageDecoder::DecodeMemory(rec->fData, rec->fSize, bitmap)) { + delete bitmap; + // we failed, so mark us to not try again + rec->fSize = NOT_AVAILABLE_ENCODE_SIZE; + return NULL; + } + // cache the answer + rec->fBitmap = bitmap; + // todo: we never know if/when to let go of this cached bitmap + // tho, since the pixels are managed separately, and are purged, + // the "leak" may not be too important + } + } + return bitmap; +} + +/////////////////////////////////////////////////////////////////////////////// + +bool EmojiFont::IsAvailable() { + return get_emoji_factory() != NULL; +} + +uint16_t EmojiFont::UnicharToGlyph(int32_t unichar) { + // do a quick range check before calling the search routine + if (unichar >= GMOJI_PUA_MIN && unichar <= GMOJI_PUA_MAX) { + // our table is stored relative to GMOJI_PUA_MIN to save space (16bits) + uint16_t relative = unichar - GMOJI_PUA_MIN; + int index = SkTSearch<uint16_t>(gGmojiPUA, GMOJI_PUA_COUNT, relative, + sizeof(uint16_t)); + // a negative value means it was not found + if (index >= 0) { + return index + kGlyphBase; + } + // fall through to return 0 + } + // not a supported emoji pua + return 0; +} + +SkScalar EmojiFont::GetAdvanceWidth(uint16_t glyphID) { + if (glyphID < kGlyphBase) { + SkDebugf("-------- bad glyph passed to EmojiFont::GetAdvanceWidth %d\n", + glyphID); + return 0; + } + + const SkBitmap* bitmap = get_bitmap(glyphID - kGlyphBase); + if (NULL == bitmap) { + return 0; + } + + // add one for 1-pixel right-side-bearing + return SkIntToScalar(bitmap->width() + 1); +} + +void EmojiFont::Draw(SkCanvas* canvas, uint16_t glyphID, + SkScalar x, SkScalar y, const SkPaint* paint) { + if (glyphID < kGlyphBase) { + SkDebugf("-------- bad glyph passed to EmojiFont::Draw %d\n", glyphID); + } + + const SkBitmap* bitmap = get_bitmap(glyphID - kGlyphBase); + if (bitmap) { + canvas->drawBitmap(*bitmap, x, y - SkIntToScalar(bitmap->height()), + paint); + } +} + +} diff --git a/emoji/EmojiFont.h b/emoji/EmojiFont.h new file mode 100644 index 0000000..22192b8 --- /dev/null +++ b/emoji/EmojiFont.h @@ -0,0 +1,80 @@ +/* + * Copyright 2009, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef android_EmojiFont_DEFINED +#define android_EmojiFont_DEFINED + +#include "SkScalar.h" +#include "SkUtils.h" + +class SkCanvas; +class SkPaint; + +namespace android { + + class EmojiFont { + public: + /** Returns true if the underlying emoji font mechanism is available. + */ + static bool IsAvailable(); + + /** Return index for the corresponding index to the emoji table, or 0 + if there is no matching emoji form. + */ + static uint16_t UnicharToGlyph(int32_t unichar); + + /** Returns true if the specified glyph is in the emoji range, i.e. was + returned by UnicharToGlyph or UTF16ToGlyph. + */ + static bool IsEmojiGlyph(uint16_t index) { + return index >= kGlyphBase; + } + + /** Returns the advance width for the specified emoji form. + */ + static SkScalar GetAdvanceWidth(uint16_t index); + + /** Draw the specified emoji form, given the x,y origin of the text + version. The paint is the one associated with the text that has + the emoji in it. + */ + static void Draw(SkCanvas*, uint16_t index, SkScalar x, SkScalar y, + const SkPaint* paintOrNull); + + private: + enum { + /* this is our internal trick to embedded private emoji glyph IDs + along side normal glyphs IDs that come from real fonts. The + assumption is that normal fonts never will report a glyph ID + above 20K or 30K, so 64000 should always be a safe starting + index. We also assume the the number of emoji will not overflow + 16bits starting at 64000 i.e. 65535 - 64000 > total emoji count + */ + kGlyphBase = 64000 + }; + }; +} + +#endif diff --git a/emoji/GmojiMaker.cpp b/emoji/GmojiMaker.cpp new file mode 100644 index 0000000..58b3fbf --- /dev/null +++ b/emoji/GmojiMaker.cpp @@ -0,0 +1,127 @@ +/* + * Copyright 2009, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include <iostream> +#include <string> +#include <vector> + +static const char gSite[] = "http://www.corp.google.com/eng/doc/emoji/dev.html"; + +using namespace std; + +static int hexchar_to_int(char c) { + if (c >= '0' && c <= '9') { + return c - '0'; + } + if (c >= 'A' && c <= 'F') { + return 10 + c - 'A'; + } + if (c >= 'a' && c <= 'f') { + return 10 + c - 'a'; + } + return -1; // unrecognized char for nex +} + +/* Tool to build gmoji_pua table, listing all of the pua values for gmoji + */ +int main (int argc, char * const argv[]) { + + char buffer[10000]; + FILE* file = fopen(argv[1], "r"); + if (NULL == file) { + std::cerr << "Can't open " << argv[1] << " for input. Aborting\n"; + std::cout << "\n"; + return -1; + } + + vector<int> unichars; + int lineNo = 0; + for (;;) { + if (fgets(buffer, sizeof(buffer), file) == 0) { + break; + } + + int prevPua = 0; + int pua = 0; + // we just want to eat the first 5 chars + for (int i = 0; i < 5; i++) { + int value = hexchar_to_int(buffer[i]); + if (value < 0) { // bad char for hex + std::cerr << "Expected hex char on line " << lineNo + << " col " << i << "\n"; + return -1; + } + pua = (pua << 4) | value; + } + if (pua < 0xFE000 || pua > 0xFEFFF) { + std::cerr << "PUA not in expected range " << pua << " line " + << lineNo << "\n"; + return -1; + } + if (pua <= prevPua) { + std::cerr << "PUA value not in ascending order line " + << lineNo << "\n"; + return -1; + } + unichars.push_back(pua); + prevPua = pua; + lineNo++; + } + + // Now output our resulting array to look like a C array + const int perLine = 8; + const int base = unichars[0]; + printf("\n"); + printf("// Compressed gmoji table, sorted\n"); + printf("// Originally scraped from %s\n", gSite); + printf("// Input text file \"%s\"\n", argv[1]); + printf("\n"); + printf("static const uint16_t gGmojiPUA[] = {\n"); + for (int i = 0; i < unichars.size(); i++) { + if ((i % perLine) == 0) { // first one + printf(" "); + } + printf("0x%03X", unichars[i] - base); + if (i == unichars.size() - 1) { // last one entirely + printf("\n"); + } + else if ((i % perLine) == (perLine - 1)) { // last one on line + printf(",\n"); + } else { + printf(", "); + } + } + printf("};\n"); + printf("\n"); + printf("#define GMOJI_PUA_MIN 0x%X\n", unichars[0]); + printf("#define GMOJI_PUA_MAX 0x%X\n", unichars[unichars.size()-1]); + printf("#define GMOJI_PUA_COUNT (sizeof(gGmojiPUA) / sizeof(gGmojiPUA[0]))\n"); + printf("// GMOJI_PUA_COUNT should be %d\n", unichars.size()); + printf("\n"); + + fclose(file); + return 0; +} diff --git a/emoji/gmoji_pua_table.h b/emoji/gmoji_pua_table.h new file mode 100644 index 0000000..3ca5c7c --- /dev/null +++ b/emoji/gmoji_pua_table.h @@ -0,0 +1,139 @@ +/* + * Copyright 2009, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +// Compressed gmoji table, sorted +// Originally scraped from http://www.corp.google.com/eng/doc/emoji/dev.html +// Input text file "external/webkit/WebKit/android/emoji/gmojiraw.txt" + +static const uint16_t gGmojiPUA[] = { + 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, + 0x008, 0x009, 0x00A, 0x00B, 0x00C, 0x00D, 0x00E, 0x00F, + 0x010, 0x011, 0x012, 0x013, 0x014, 0x015, 0x016, 0x017, + 0x018, 0x019, 0x01A, 0x01B, 0x01C, 0x01D, 0x01E, 0x01F, + 0x020, 0x021, 0x022, 0x023, 0x024, 0x025, 0x026, 0x027, + 0x028, 0x029, 0x02A, 0x02B, 0x02C, 0x02D, 0x02E, 0x02F, + 0x030, 0x031, 0x032, 0x033, 0x034, 0x035, 0x036, 0x037, + 0x038, 0x039, 0x03A, 0x03B, 0x03C, 0x03D, 0x03E, 0x03F, + 0x040, 0x041, 0x042, 0x043, 0x044, 0x045, 0x046, 0x047, + 0x048, 0x049, 0x04A, 0x04B, 0x04C, 0x04D, 0x04E, 0x04F, + 0x050, 0x051, 0x052, 0x053, 0x054, 0x055, 0x056, 0x057, + 0x058, 0x059, 0x05A, 0x05B, 0x190, 0x191, 0x192, 0x193, + 0x194, 0x195, 0x196, 0x197, 0x198, 0x199, 0x19A, 0x19B, + 0x19C, 0x19D, 0x19E, 0x19F, 0x1A0, 0x1A1, 0x1A2, 0x1A3, + 0x1A4, 0x1A5, 0x1A6, 0x1A7, 0x1A8, 0x1A9, 0x1AA, 0x1AB, + 0x1AC, 0x1AD, 0x1AE, 0x1AF, 0x1B0, 0x1B1, 0x1B2, 0x1B3, + 0x1B4, 0x1B5, 0x1B6, 0x1B7, 0x1B8, 0x1B9, 0x1BA, 0x1BB, + 0x1BC, 0x1BD, 0x1BE, 0x1BF, 0x1C0, 0x1C1, 0x1C2, 0x1C3, + 0x1C4, 0x1C5, 0x1C6, 0x1C7, 0x1C8, 0x1C9, 0x1CA, 0x1CB, + 0x1CC, 0x1CD, 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, + 0x1D4, 0x1D5, 0x1D6, 0x1D7, 0x1D8, 0x1D9, 0x1DA, 0x1DB, + 0x1DC, 0x1DD, 0x1DE, 0x1DF, 0x1E0, 0x1E1, 0x1E2, 0x1E3, + 0x320, 0x321, 0x322, 0x323, 0x324, 0x325, 0x326, 0x327, + 0x328, 0x329, 0x32A, 0x32B, 0x32C, 0x32D, 0x32E, 0x32F, + 0x330, 0x331, 0x332, 0x333, 0x334, 0x335, 0x336, 0x337, + 0x338, 0x339, 0x33A, 0x33B, 0x33C, 0x33D, 0x33E, 0x33F, + 0x340, 0x341, 0x342, 0x343, 0x344, 0x345, 0x346, 0x347, + 0x348, 0x349, 0x34A, 0x34B, 0x34C, 0x34D, 0x34E, 0x34F, + 0x350, 0x351, 0x352, 0x353, 0x354, 0x355, 0x356, 0x357, + 0x358, 0x359, 0x35A, 0x35B, 0x35C, 0x35D, 0x35E, 0x35F, + 0x360, 0x361, 0x362, 0x363, 0x364, 0x365, 0x366, 0x367, + 0x368, 0x369, 0x4B0, 0x4B1, 0x4B2, 0x4B3, 0x4B4, 0x4B5, + 0x4B6, 0x4B7, 0x4B8, 0x4B9, 0x4BA, 0x4BB, 0x4BC, 0x4BD, + 0x4BE, 0x4BF, 0x4C0, 0x4C1, 0x4C2, 0x4C3, 0x4C4, 0x4C5, + 0x4C6, 0x4C7, 0x4C8, 0x4C9, 0x4CA, 0x4CB, 0x4CC, 0x4CD, + 0x4CE, 0x4CF, 0x4D0, 0x4D1, 0x4D2, 0x4D3, 0x4D4, 0x4D5, + 0x4D6, 0x4D7, 0x4D8, 0x4D9, 0x4DA, 0x4DB, 0x4DC, 0x4DD, + 0x4DE, 0x4DF, 0x4E0, 0x4E1, 0x4E2, 0x4E3, 0x4E4, 0x4E5, + 0x4E6, 0x4E7, 0x4E8, 0x4E9, 0x4EA, 0x4EB, 0x4EC, 0x4ED, + 0x4EE, 0x4EF, 0x4F0, 0x4F1, 0x4F2, 0x4F3, 0x4F4, 0x4F5, + 0x4F6, 0x4F7, 0x4F8, 0x4F9, 0x4FA, 0x4FB, 0x4FC, 0x4FD, + 0x4FE, 0x4FF, 0x500, 0x501, 0x502, 0x503, 0x504, 0x505, + 0x506, 0x507, 0x508, 0x509, 0x50A, 0x50B, 0x50C, 0x50D, + 0x50E, 0x50F, 0x510, 0x511, 0x512, 0x513, 0x514, 0x515, + 0x516, 0x517, 0x518, 0x519, 0x51A, 0x51B, 0x51C, 0x51D, + 0x51E, 0x51F, 0x520, 0x521, 0x522, 0x523, 0x524, 0x525, + 0x526, 0x527, 0x528, 0x529, 0x52A, 0x52B, 0x52C, 0x52D, + 0x52E, 0x52F, 0x530, 0x531, 0x532, 0x533, 0x534, 0x535, + 0x536, 0x537, 0x538, 0x539, 0x53A, 0x53B, 0x53C, 0x53D, + 0x53E, 0x53F, 0x540, 0x541, 0x542, 0x543, 0x544, 0x545, + 0x546, 0x547, 0x548, 0x549, 0x54A, 0x54B, 0x54C, 0x54D, + 0x54E, 0x54F, 0x550, 0x551, 0x552, 0x553, 0x7D0, 0x7D1, + 0x7D2, 0x7D3, 0x7D4, 0x7D5, 0x7D6, 0x7D7, 0x7D8, 0x7D9, + 0x7DA, 0x7DB, 0x7DC, 0x7DD, 0x7DE, 0x7DF, 0x7E0, 0x7E1, + 0x7E2, 0x7E3, 0x7E4, 0x7E5, 0x7E6, 0x7E7, 0x7E8, 0x7E9, + 0x7EA, 0x7EB, 0x7EC, 0x7ED, 0x7EE, 0x7EF, 0x7F0, 0x7F1, + 0x7F2, 0x7F3, 0x7F4, 0x7F5, 0x7F6, 0x7F7, 0x7F8, 0x7F9, + 0x7FA, 0x7FB, 0x7FC, 0x7FD, 0x7FE, 0x7FF, 0x800, 0x801, + 0x802, 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, + 0x80A, 0x80B, 0x80C, 0x80D, 0x80E, 0x80F, 0x810, 0x811, + 0x812, 0x813, 0x814, 0x815, 0x816, 0x817, 0x818, 0x819, + 0x81A, 0x81B, 0x81C, 0x81D, 0x81E, 0x81F, 0x820, 0x821, + 0x822, 0x823, 0x824, 0x825, 0x826, 0x827, 0x828, 0x829, + 0x82A, 0x82B, 0x82C, 0x82D, 0x82E, 0x82F, 0x830, 0x831, + 0x832, 0x833, 0x834, 0x835, 0x836, 0x837, 0x838, 0x839, + 0x83A, 0x83B, 0x83C, 0x960, 0x961, 0x962, 0x963, 0x964, + 0x965, 0x966, 0x967, 0x968, 0x969, 0x96A, 0x96B, 0x96C, + 0x96D, 0x96E, 0x96F, 0x970, 0x971, 0x972, 0x973, 0x974, + 0x975, 0x976, 0x977, 0x978, 0x979, 0x97A, 0x97B, 0x97C, + 0x97D, 0x97E, 0x97F, 0x980, 0x981, 0x982, 0x983, 0x984, + 0x985, 0x986, 0x987, 0x988, 0xAF0, 0xAF1, 0xAF2, 0xAF3, + 0xAF4, 0xAF5, 0xAF6, 0xAF7, 0xAF8, 0xAF9, 0xAFA, 0xAFB, + 0xAFC, 0xAFD, 0xAFE, 0xAFF, 0xB00, 0xB01, 0xB02, 0xB03, + 0xB04, 0xB05, 0xB06, 0xB07, 0xB08, 0xB09, 0xB0A, 0xB0B, + 0xB0C, 0xB0D, 0xB0E, 0xB0F, 0xB10, 0xB11, 0xB12, 0xB13, + 0xB14, 0xB15, 0xB16, 0xB17, 0xB18, 0xB19, 0xB1A, 0xB1B, + 0xB1C, 0xB1D, 0xB1E, 0xB1F, 0xB20, 0xB21, 0xB22, 0xB23, + 0xB24, 0xB25, 0xB26, 0xB27, 0xB28, 0xB29, 0xB2A, 0xB2B, + 0xB2C, 0xB2D, 0xB2E, 0xB2F, 0xB30, 0xB31, 0xB32, 0xB33, + 0xB34, 0xB35, 0xB36, 0xB37, 0xB38, 0xB39, 0xB3A, 0xB3B, + 0xB3C, 0xB3D, 0xB3E, 0xB3F, 0xB40, 0xB41, 0xB42, 0xB43, + 0xB44, 0xB45, 0xB46, 0xB47, 0xB48, 0xB49, 0xB4A, 0xB4B, + 0xB4C, 0xB4D, 0xB4E, 0xB4F, 0xB50, 0xB51, 0xB52, 0xB53, + 0xB54, 0xB55, 0xB56, 0xB57, 0xB58, 0xB59, 0xB5A, 0xB5B, + 0xB5C, 0xB5D, 0xB5E, 0xB5F, 0xB60, 0xB61, 0xB62, 0xB63, + 0xB64, 0xB65, 0xB66, 0xB67, 0xB68, 0xB69, 0xB6A, 0xB6B, + 0xB6C, 0xB6D, 0xB6E, 0xB6F, 0xB70, 0xB71, 0xB72, 0xB73, + 0xB74, 0xB75, 0xB76, 0xB77, 0xB78, 0xB79, 0xB7A, 0xB7B, + 0xB7C, 0xB7D, 0xB7E, 0xB7F, 0xB80, 0xB81, 0xB82, 0xB83, + 0xB84, 0xB85, 0xB86, 0xB87, 0xB88, 0xB89, 0xB8A, 0xB8B, + 0xB8C, 0xB8D, 0xB8E, 0xB8F, 0xB90, 0xB91, 0xB92, 0xB93, + 0xB94, 0xB95, 0xB96, 0xB97, 0xB98, 0xB99, 0xB9A, 0xB9B, + 0xB9C, 0xB9D, 0xB9E, 0xB9F, 0xBA0, 0xBA1, 0xBA2, 0xE10, + 0xE11, 0xE12, 0xE13, 0xE14, 0xE15, 0xE16, 0xE17, 0xE18, + 0xE19, 0xE1A, 0xE1B, 0xE1C, 0xE1D, 0xE1E, 0xE1F, 0xE20, + 0xE21, 0xE22, 0xE23, 0xE24, 0xE25, 0xE26, 0xE27, 0xE28, + 0xE29, 0xE2A, 0xE2B, 0xE2C, 0xE2D, 0xE2E, 0xE2F, 0xE30, + 0xE31, 0xE32, 0xE33, 0xE40, 0xE41, 0xE42, 0xE43, 0xE44, + 0xE45, 0xE46, 0xE47, 0xE48, 0xE49, 0xE4A, 0xE70, 0xE71, + 0xE72, 0xE73, 0xE74, 0xE75, 0xE76, 0xE77, 0xE78, 0xE79, + 0xE7A, 0xE7B, 0xE7C, 0xE7D, 0xEA0 +}; + +#define GMOJI_PUA_MIN 0xFE000 +#define GMOJI_PUA_MAX 0xFEEA0 +#define GMOJI_PUA_COUNT (sizeof(gGmojiPUA) / sizeof(gGmojiPUA[0])) +// GMOJI_PUA_COUNT should be 805 + diff --git a/emoji/gmojiraw.txt b/emoji/gmojiraw.txt new file mode 100644 index 0000000..33ad18d --- /dev/null +++ b/emoji/gmojiraw.txt @@ -0,0 +1,805 @@ +FE000 \uDBB8\uDC00 \xF3\xBE\x80\x80 BLACK SUN WITH RAYS 44 F660 E488 7541 EB60 1 F89F E63E 7541 74 F98B E04A 7541 +FE001 \uDBB8\uDC01 \xF3\xBE\x80\x81 CLOUD 107 F665 E48D 7546 EB65 2 F8A0 E63F 7546 73 F98A E049 7546 +FE002 \uDBB8\uDC02 \xF3\xBE\x80\x82 UMBRELLA WITH RAIN DROPS 95 F664 E48C 7545 EB64 3 F8A1 E640 7545 75 F98C E04B 7545 +FE003 \uDBB8\uDC03 \xF3\xBE\x80\x83 SNOWMAN 191 F65D E485 753E EB5D 4 F8A2 E641 753E 72 F989 E048 753E +FE004 \uDBB8\uDC04 \xF3\xBE\x80\x84 LIGHTNING SYMBOL 16 F65F E487 7540 EB5F 5 F8A3 E642 7540 151 F77D E13D 7540 +FE005 \uDBB8\uDC05 \xF3\xBE\x80\x85 CYCLONE 190 F641 E469 7522 EB41 6 F8A4 E643 7522 414 FB84 E443 7522 +FE006 \uDBB8\uDC06 \xF3\xBE\x80\x86 FOG 305 F7B5 E598 7837 ECB5 7 F8A5 E644 7837 [霧] +FE007 \uDBB8\uDC07 \xF3\xBE\x80\x87 CLOSED UMBRELLA 481 F3BC EAE8 7A3E EDBC 8 F8A6 E645 7A3E 407 FB7C E43C 7A3E +FE008 \uDBB8\uDC08 \xF3\xBE\x80\x88 NIGHT WITH STARS 490 F3C5 EAF1 7A47 EDC5 172 F957 E6B3 7A47 422 FB8C E44B 7A47 +FE009 \uDBB8\uDC09 \xF3\xBE\x80\x89 SUNRISE OVER MOUNTAINS 493 F3C8 EAF4 7A4A EDC8 1 F89F E63E 7541 77 F98E E04D 7D53 +FE00A \uDBB8\uDC0A \xF3\xBE\x80\x8A SUNRISE 493 F3C8 EAF4 7A4A EDC8 1 F89F E63E 7541 420 FB8A E449 7A4A +FE00B \uDBB8\uDC0B \xF3\xBE\x80\x8B CITYSCAPE AT DUSK 371 F34D E5DA 792E ED4D [夕焼け] 160 F787 E146 792E +FE00C \uDBB8\uDC0C \xF3\xBE\x80\x8C SUNSET OVER BUILDINGS 371 F34D E5DA 792E ED4D 1 F89F E63E 7541 421 FB8B E44A 7D4E +FE00D \uDBB8\uDC0D \xF3\xBE\x80\x8D RAINBOW 491 F3C6 EAF2 7A48 EDC6 [虹] 423 FB8D E44C 7A48 +FE00E \uDBB8\uDC0E \xF3\xBE\x80\x8E SNOWFLAKE 60 F662 E48A 7543 EB62 [雪結晶] [雪結晶] +FE00F \uDBB8\uDC0F \xF3\xBE\x80\x8F PARTLY CLOUDY 167 F666 E48E 7547 EB66 1+2 F89F+F8A0 E63E+E63F 7541+7546 74+73 F98B+F98A E04A+E049 7541+7546 +FE010 \uDBB8\uDC10 \xF3\xBE\x80\x90 BRIDGE AT NIGHT 227 F698 E4BF 7578 EB98 172 F957 E6B3 7A47 422 FB8C E44B 7A47 +FE011 \uDBB8\uDC11 \xF3\xBE\x80\x91 NEW MOON 321 F7C5 E5A8 7847 ECC5 95 F940 E69C 7847 ● +FE012 \uDBB8\uDC12 \xF3\xBE\x80\x92 WAXING MOON 322 F7C6 E5A9 7848 ECC6 96 F941 E69D 7848 76 F98D E04C 753F +FE013 \uDBB8\uDC13 \xF3\xBE\x80\x93 HALF MOON 323 F7C7 E5AA 7849 ECC7 97 F942 E69E 7849 76 F98D E04C 753F +FE014 \uDBB8\uDC14 \xF3\xBE\x80\x94 CRESCENT MOON 15 F65E E486 753F EB5E 98 F943 E69F 753F 76 F98D E04C 753F +FE015 \uDBB8\uDC15 \xF3\xBE\x80\x95 FULL MOON ○ 99 F944 E6A0 7E24 ○ +FE016 \uDBB8\uDC16 \xF3\xBE\x80\x96 HALF MOON WITH FACE 47 F661 E489 7542 EB61 97 F942 E69E 7849 76 F98D E04C 753F +FE017 \uDBB8\uDC17 \xF3\xBE\x80\x97 MOON OVER A HOUSE 488 F3C3 EAEF 7A45 EDC3 [お月見] 417 FB87 E446 7A45 +FE018 \uDBB8\uDC18 \xF3\xBE\x80\x98 SOON WITH RIGHT ARROW ABOVE [SOON] 173 F95B E6B7 7E2D [SOON] +FE019 \uDBB8\uDC19 \xF3\xBE\x80\x99 ON WITH DOUBLE POINTING ARROW ABOVE [ON] 174 F95C E6B8 7E2E [ON] +FE01A \uDBB8\uDC1A \xF3\xBE\x80\x9A END WITH LEFT ARROW ABOVE [end] 175 F95D E6B9 7E2F [end] +FE01B \uDBB8\uDC1B \xF3\xBE\x80\x9B HOURGLASS 58 F654 E47C 7535 EB54 317 F9C1 E71C 7535 [砂時計] +FE01C \uDBB8\uDC1C \xF3\xBE\x80\x9C HOURGLASS 2 57 F798 E57B 7778 EC98 317 F9C1 E71C 7535 [砂時計] +FE01D \uDBB8\uDC1D \xF3\xBE\x80\x9D WATCH 25 F797 E57A 7777 EC97 320 F9C4 E71F 7777 [腕時計] +FE01E \uDBB8\uDC1E \xF3\xBE\x80\x9E 1 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 36 F964 E024 7D26 +FE01F \uDBB8\uDC1F \xF3\xBE\x80\x9F 2 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 37 F965 E025 7D27 +FE020 \uDBB8\uDC20 \xF3\xBE\x80\xA0 3 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 38 F966 E026 7D28 +FE021 \uDBB8\uDC21 \xF3\xBE\x80\xA1 4 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 39 F967 E027 7D29 +FE022 \uDBB8\uDC22 \xF3\xBE\x80\xA2 5 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 40 F968 E028 7D2A +FE023 \uDBB8\uDC23 \xF3\xBE\x80\xA3 6 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 41 F969 E029 7D2B +FE024 \uDBB8\uDC24 \xF3\xBE\x80\xA4 7 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 42 F96A E02A 7D2C +FE025 \uDBB8\uDC25 \xF3\xBE\x80\xA5 8 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 43 F96B E02B 7D2D +FE026 \uDBB8\uDC26 \xF3\xBE\x80\xA6 9 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 44 F96C E02C 7D2E +FE027 \uDBB8\uDC27 \xF3\xBE\x80\xA7 10 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 45 F96D E02D 7D2F +FE028 \uDBB8\uDC28 \xF3\xBE\x80\xA8 11 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 46 F96E E02E 7D30 +FE029 \uDBB8\uDC29 \xF3\xBE\x80\xA9 12 OCLOCK 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 47 F96F E02F 7D31 +FE02A \uDBB8\uDC2A \xF3\xBE\x80\xAA CLOCK SYMBOL 46 F7B1 E594 7833 ECB1 176 F95E E6BA 7833 45 F96D E02D 7D2F +FE02B \uDBB8\uDC2B \xF3\xBE\x80\xAB ARIES 192 F667 E48F 7548 EB67 9 F8A7 E646 7548 243 F7DF E23F 7548 +FE02C \uDBB8\uDC2C \xF3\xBE\x80\xAC TAURUS 193 F668 E490 7549 EB68 10 F8A8 E647 7549 244 F7E0 E240 7549 +FE02D \uDBB8\uDC2D \xF3\xBE\x80\xAD GEMINI 194 F669 E491 754A EB69 11 F8A9 E648 754A 245 F7E1 E241 754A +FE02E \uDBB8\uDC2E \xF3\xBE\x80\xAE CANCER 195 F66A E492 754B EB6A 12 F8AA E649 754B 246 F7E2 E242 754B +FE02F \uDBB8\uDC2F \xF3\xBE\x80\xAF LEO 196 F66B E493 754C EB6B 13 F8AB E64A 754C 247 F7E3 E243 754C +FE030 \uDBB8\uDC30 \xF3\xBE\x80\xB0 VIRGO 197 F66C E494 754D EB6C 14 F8AC E64B 754D 248 F7E4 E244 754D +FE031 \uDBB8\uDC31 \xF3\xBE\x80\xB1 LIBRA 198 F66D E495 754E EB6D 15 F8AD E64C 754E 249 F7E5 E245 754E +FE032 \uDBB8\uDC32 \xF3\xBE\x80\xB2 SCORPIO 199 F66E E496 754F EB6E 16 F8AE E64D 754F 250 F7E6 E246 754F +FE033 \uDBB8\uDC33 \xF3\xBE\x80\xB3 SAGITTARIUS 200 F66F E497 7550 EB6F 17 F8AF E64E 7550 251 F7E7 E247 7550 +FE034 \uDBB8\uDC34 \xF3\xBE\x80\xB4 CAPRICORN 201 F670 E498 7551 EB70 18 F8B0 E64F 7551 252 F7E8 E248 7551 +FE035 \uDBB8\uDC35 \xF3\xBE\x80\xB5 AQUARIUS 202 F671 E499 7552 EB71 19 F8B1 E650 7552 253 F7E9 E249 7552 +FE036 \uDBB8\uDC36 \xF3\xBE\x80\xB6 PISCES 203 F672 E49A 7553 EB72 20 F8B2 E651 7553 254 F7EA E24A 7553 +FE037 \uDBB8\uDC37 \xF3\xBE\x80\xB7 OPHIUCUS 204 F673 E49B 7554 EB73 [蛇使座] 255 F7EB E24B 7554 +FE038 \uDBB8\uDC38 \xF3\xBE\x80\xB8 WATER WAVE 810 F481 EB7C 7B61 EE81 352 F9E4 E73F 7B61 409 FB7E E43E 7B61 +FE039 \uDBB8\uDC39 \xF3\xBE\x80\xB9 GREEN EARTH 332 F7D0 E5B3 7852 ECD0 [地球] [地球] +FE03A \uDBB8\uDC3A \xF3\xBE\x80\xBA VOLCANO 769 F457 EB53 7B38 EE57 [火山] [火山] +FE03B \uDBB8\uDC3B \xF3\xBE\x80\xBB MILKY WAY 781 F463 EB5F 7B44 EE63 172 F957 E6B3 7A47 422 FB8C E44B 7A47 +FE03C \uDBB8\uDC3C \xF3\xBE\x80\xBC FOUR LEAFED CLOVER 53 F6EC E513 766E EBEC 354 F9E6 E741 766E 106 F750 E110 766E +FE03D \uDBB8\uDC3D \xF3\xBE\x80\xBD TULIP 113 F6BD E4E4 763F EBBD 356 F9E8 E743 763F 274 F9A4 E304 763F +FE03E \uDBB8\uDC3E \xF3\xBE\x80\xBE SEEDLING 811 F482 EB7D 7B62 EE82 359 F9EB E746 7B62 106 F750 E110 766E +FE03F \uDBB8\uDC3F \xF3\xBE\x80\xBF MAPLE LEAF 133 F6A7 E4CE 7629 EBA7 360 F9EC E747 7629 114 F758 E118 7629 +FE040 \uDBB8\uDC40 \xF3\xBE\x81\x80 CHERRY BLOSSOM 235 F6A3 E4CA 7625 EBA3 361 F9ED E748 7625 48 F970 E030 7625 +FE041 \uDBB8\uDC41 \xF3\xBE\x81\x81 ROSE 339 F7EA E5BA 786C ECEA [バラ] 50 F972 E032 786C +FE042 \uDBB8\uDC42 \xF3\xBE\x81\x82 FALLEN LEAF 358 F340 E5CD 7921 ED40 360 F9EC E747 7629 115 F759 E119 7921 +FE043 \uDBB8\uDC43 \xF3\xBE\x81\x83 LEAF FLUTTERING IN WIND 358 F340 E5CD 7921 ED40 〓 418 FB88 E447 7D4D +FE044 \uDBB8\uDC44 \xF3\xBE\x81\x84 YOUNG GREEN LEAF 179 F658 E480 7539 EB58 [若葉マーク] 189 F7A9 E209 7539 +FE045 \uDBB8\uDC45 \xF3\xBE\x81\x85 HIBISCUS 397 F367 EA94 7948 ED67 [ハイビスカス] 273 F9A3 E303 7948 +FE046 \uDBB8\uDC46 \xF3\xBE\x81\x86 SUNFLOWER 256 F6BC E4E3 763E EBBC [ひまわり] 275 F9A5 E305 763E +FE047 \uDBB8\uDC47 \xF3\xBE\x81\x87 PALM TREE 255 F6BB E4E2 763D EBBB [ビーチ] 277 F9A7 E307 763D +FE048 \uDBB8\uDC48 \xF3\xBE\x81\x88 CACTUS 399 F369 EA96 794A ED69 [サボテン] 278 F9A8 E308 794A +FE049 \uDBB8\uDC49 \xF3\xBE\x81\x89 EAR OF RICE 〓 〓 415 FB85 E444 7D65 +FE04A \uDBB8\uDC4A \xF3\xBE\x81\x8A CORN 740 F3F7 EB36 7A79 EDF7 [とうもろこし] [とうもろこし] +FE04B \uDBB8\uDC4B \xF3\xBE\x81\x8B MUSHROOM 741 F3F8 EB37 7A7A EDF8 [キノコ] [キノコ] +FE04C \uDBB8\uDC4C \xF3\xBE\x81\x8C CHESTNUT 742 F3F9 EB38 7A7B EDF9 [栗] [栗] +FE04D \uDBB8\uDC4D \xF3\xBE\x81\x8D FLOWER 759 F44D EB49 7B2E EE4D [花] 275 F9A5 E305 763E +FE04E \uDBB8\uDC4E \xF3\xBE\x81\x8E HERB 816 F487 EB82 7B67 EE87 354 F9E6 E741 766E 106 F750 E110 766E +FE04F \uDBB8\uDC4F \xF3\xBE\x81\x8F CHERRIES 241 F6AB E4D2 762D EBAB 355 F9E7 E742 762D [さくらんぼ] +FE050 \uDBB8\uDC50 \xF3\xBE\x81\x90 BANANA 739 F3F6 EB35 7A78 EDF6 357 F9E9 E744 7A78 [バナナ] +FE051 \uDBB8\uDC51 \xF3\xBE\x81\x91 APPLE 434 F38D EAB9 796D ED8D 358 F9EA E745 796D 339 F9E5 E345 796D +FE052 \uDBB8\uDC52 \xF3\xBE\x81\x92 TANGERINE 435 F38E EABA 796E ED8E [みかん] 340 F9E6 E346 796E +FE053 \uDBB8\uDC53 \xF3\xBE\x81\x93 STRAWBERRY 243 F6AD E4D4 762F EBAD [イチゴ] 341 F9E7 E347 762F +FE054 \uDBB8\uDC54 \xF3\xBE\x81\x94 WATERMELON 238 F6A6 E4CD 7628 EBA6 [スイカ] 342 F9E8 E348 7628 +FE055 \uDBB8\uDC55 \xF3\xBE\x81\x95 TOMATO 436 F38F EABB 796F ED8F [トマト] 343 F9E9 E349 796F +FE056 \uDBB8\uDC56 \xF3\xBE\x81\x96 EGGPLANT 437 F390 EABC 7970 ED90 [ナス] 344 F9EA E34A 7970 +FE057 \uDBB8\uDC57 \xF3\xBE\x81\x97 MELON 736 F3F3 EB32 7A75 EDF3 [メロン] [メロン] +FE058 \uDBB8\uDC58 \xF3\xBE\x81\x98 PINEAPPLE 737 F3F4 EB33 7A76 EDF4 [パイナップル] [パイナップル] +FE059 \uDBB8\uDC59 \xF3\xBE\x81\x99 GRAPES 738 F3F5 EB34 7A77 EDF5 [ブドウ] [ブドウ] +FE05A \uDBB8\uDC5A \xF3\xBE\x81\x9A PEACH 743 F3FA EB39 7A7C EDFA [モモ] [モモ] +FE05B \uDBB8\uDC5B \xF3\xBE\x81\x9B GREEN APPLE 776 F45E EB5A 7B3F EE5E 358 F9EA E745 796D 339 F9E5 E345 796D +FE190 \uDBB8\uDD90 \xF3\xBE\x86\x90 EYES 317 F7C1 E5A4 7843 ECC1 84 F8F2 E691 7843 372 FB59 E419 7843 +FE191 \uDBB8\uDD91 \xF3\xBE\x86\x91 EAR 318 F7C2 E5A5 7844 ECC2 85 F8F3 E692 7844 374 FB5B E41B 7844 +FE192 \uDBB8\uDD92 \xF3\xBE\x86\x92 NOSE 457 F3A4 EAD0 7A26 EDA4 [鼻] 373 FB5A E41A 7A26 +FE193 \uDBB8\uDD93 \xF3\xBE\x86\x93 MOUTH 458 F3A5 EAD1 7A27 EDA5 149 F99E E6F9 7646 375 FB5C E41C 7A27 +FE194 \uDBB8\uDD94 \xF3\xBE\x86\x94 TONGUE 757 F44B EB47 7B2C EE4B 329 F9CD E728 7642 356 FB49 E409 7D47 +FE195 \uDBB8\uDD95 \xF3\xBE\x86\x95 LIPSTICK 295 F6E2 E509 7664 EBE2 305 F9B5 E710 7664 298 F9BC E31C 7664 +FE196 \uDBB8\uDD96 \xF3\xBE\x86\x96 NAIL POLISH 409 F373 EAA0 7954 ED73 [マニキュア] 299 F9BD E31D 7954 +FE197 \uDBB8\uDD97 \xF3\xBE\x86\x97 FACE MASSAGE 297 F6E4 E50B 7666 EBE4 [エステ] 300 F9BE E31E 7666 +FE198 \uDBB8\uDD98 \xF3\xBE\x86\x98 HAIR NEEDING A CUT 410 F374 EAA1 7955 ED74 56 F8D6 E675 7671 301 F9BF E31F 7955 +FE199 \uDBB8\uDD99 \xF3\xBE\x86\x99 BARBER POLE 411 F375 EAA2 7956 ED75 [床屋] 302 F9C0 E320 7956 +FE19A \uDBB8\uDD9A \xF3\xBE\x86\x9A SILHOUETTE OF BUST 〓 170 F955 E6B1 7E2C 〓 +FE19B \uDBB8\uDD9B \xF3\xBE\x86\x9B BOYS HEAD 80 F6D5 E4FC 7657 EBD5 140 F995 E6F0 752A 1 F941 E001 7D37 +FE19C \uDBB8\uDD9C \xF3\xBE\x86\x9C GIRLS HEAD 50 F6D3 E4FA 7655 EBD3 140 F995 E6F0 752A 2 F942 E002 7D32 +FE19D \uDBB8\uDD9D \xF3\xBE\x86\x9D MANS HEAD 80 F6D5 E4FC 7657 EBD5 140 F995 E6F0 752A 4 F944 E004 7657 +FE19E \uDBB8\uDD9E \xF3\xBE\x86\x9E WOMANS HEAD 50 F6D3 E4FA 7655 EBD3 140 F995 E6F0 752A 5 F945 E005 7655 +FE19F \uDBB8\uDD9F \xF3\xBE\x86\x9F FAMILY 163 F6DA E501 765C EBDA [家族] [家族] +FE1A0 \uDBB8\uDDA0 \xF3\xBE\x86\xA0 CHILDREN 〓 〓 387 FB68 E428 7D64 +FE1A1 \uDBB8\uDDA1 \xF3\xBE\x86\xA1 POLICE 374 F350 E5DD 7931 ED50 [警官] 172 F793 E152 7931 +FE1A2 \uDBB8\uDDA2 \xF3\xBE\x86\xA2 WOMAN WITH BUNNY EARS 468 F3AF EADB 7A31 EDAF [バニー] 388 FB69 E429 7A31 +FE1A3 \uDBB8\uDDA3 \xF3\xBE\x86\xA3 BRIDE WITH VEIL 482 F3BD EAE9 7A3F EDBD [花嫁] [花嫁] +FE1A4 \uDBB8\uDDA4 \xF3\xBE\x86\xA4 BLOND PERSON 705 F3D4 EB13 7A56 EDD4 [白人] 444 FBB5 E515 7A56 +FE1A5 \uDBB8\uDDA5 \xF3\xBE\x86\xA5 MAN WITH LONG MOUSTACHE 706 F3D5 EB14 7A57 EDD5 [中国人] 445 FBB6 E516 7A57 +FE1A6 \uDBB8\uDDA6 \xF3\xBE\x86\xA6 MAN WITH TURBAN 707 F3D6 EB15 7A58 EDD6 [インド] 446 FBB7 E517 7A58 +FE1A7 \uDBB8\uDDA7 \xF3\xBE\x86\xA7 OLDER MAN 708 F3D7 EB16 7A59 EDD7 [おじいさん] 447 FBB8 E518 7A59 +FE1A8 \uDBB8\uDDA8 \xF3\xBE\x86\xA8 OLDER WOMAN 709 F3D8 EB17 7A5A EDD8 [おばあさん] 448 FBB9 E519 7A5A +FE1A9 \uDBB8\uDDA9 \xF3\xBE\x86\xA9 BABY 710 F3D9 EB18 7A5B EDD9 [赤ちゃん] 449 FBBA E51A 7A5B +FE1AA \uDBB8\uDDAA \xF3\xBE\x86\xAA CONSTRUCTION WORKER 711 F3DA EB19 7A5C EDDA [工事現場の人] 450 FBBB E51B 7A5C +FE1AB \uDBB8\uDDAB \xF3\xBE\x86\xAB PRINCESS 712 F3DB EB1A 7A5D EDDB [お姫様] 451 FBBC E51C 7A5D +FE1AC \uDBB8\uDDAC \xF3\xBE\x86\xAC RED FACED OGRE 754 F448 EB44 7B29 EE48 [なまはげ] [なまはげ] +FE1AD \uDBB8\uDDAD \xF3\xBE\x86\xAD LONG NOSED GOBLIN 755 F449 EB45 7B2A EE49 [天狗] [天狗] +FE1AE \uDBB8\uDDAE \xF3\xBE\x86\xAE GHOST 236 F6A4 E4CB 7626 EBA4 [お化け] 117 F75B E11B 7626 +FE1AF \uDBB8\uDDAF \xF3\xBE\x86\xAF ANGEL 344 F7EF E5BF 7871 ECEF [天使] 78 F98F E04E 7871 +FE1B0 \uDBB8\uDDB0 \xF3\xBE\x86\xB0 EXTRATERRESTRIAL ALIEN 302 F6E7 E50E 7669 EBE7 [UFO] 102 F74C E10C 7D48 +FE1B1 \uDBB8\uDDB1 \xF3\xBE\x86\xB1 ALIEN MONSTER 274 F6C5 E4EC 7647 EBC5 [宇宙人] 133 F76B E12B 7647 +FE1B2 \uDBB8\uDDB2 \xF3\xBE\x86\xB2 DEVIL 277 F6C8 E4EF 764A EBC8 [アクマ] 116 F75A E11A 764A +FE1B3 \uDBB8\uDDB3 \xF3\xBE\x86\xB3 SKULL 286 F6D1 E4F8 7653 EBD1 [ドクロ] 118 F75C E11C 7653 +FE1B4 \uDBB8\uDDB4 \xF3\xBE\x86\xB4 NEWSCASTER 〓 〓 263 F7F3 E253 7D62 +FE1B5 \uDBB8\uDDB5 \xF3\xBE\x86\xB5 YEOMAN OF THE GUARD 〓 〓 453 FBBE E51E 7D68 +FE1B6 \uDBB8\uDDB6 \xF3\xBE\x86\xB6 DANCER 714 F3DD EB1C 7A5F EDDD [ダンス] 454 FBBF E51F 7A5F +FE1B7 \uDBB8\uDDB7 \xF3\xBE\x86\xB7 DOG 134 F6BA E4E1 763C EBBA 100 F945 E6A1 763C 82 F993 E052 763C +FE1B8 \uDBB8\uDDB8 \xF3\xBE\x86\xB8 CAT 251 F6B4 E4DB 7636 EBB4 101 F946 E6A2 7636 79 F990 E04F 7636 +FE1B9 \uDBB8\uDDB9 \xF3\xBE\x86\xB9 SNAIL 812 F483 EB7E 7B63 EE83 367 F9F3 E74E 7B63 [カタツムリ] +FE1BA \uDBB8\uDDBA \xF3\xBE\x86\xBA BABY CHICK 78 F6B9 E4E0 763B EBB9 368 F9F4 E74F 763B 458 FBC3 E523 763B +FE1BB \uDBB8\uDDBB \xF3\xBE\x86\xBB BABY CHICK 2 804 F47A EB76 7B5B EE7A 368 F9F4 E74F 763B 458 FBC3 E523 763B +FE1BC \uDBB8\uDDBC \xF3\xBE\x86\xBC PENGUIN 252 F6B5 E4DC 7637 EBB5 369 F9F5 E750 7637 85 F996 E055 7637 +FE1BD \uDBB8\uDDBD \xF3\xBE\x86\xBD FISH 203 F672 E49A 7553 EB72 370 F9F6 E751 7A60 25 F959 E019 7D41 +FE1BE \uDBB8\uDDBE \xF3\xBE\x86\xBE HORSE 248 F6B1 E4D8 7633 EBB1 373 F9F9 E754 7633 26 F95A E01A 7633 +FE1BF \uDBB8\uDDBF \xF3\xBE\x86\xBF PIG 254 F6B7 E4DE 7639 EBB7 374 F9FA E755 7639 101 F74B E10B 7639 +FE1C0 \uDBB8\uDDC0 \xF3\xBE\x87\x80 TIGER 345 F7F0 E5C0 7872 ECF0 [トラ] 80 F991 E050 7872 +FE1C1 \uDBB8\uDDC1 \xF3\xBE\x87\x81 BEAR 346 F7F1 E5C1 7873 ECF1 [クマ] 81 F992 E051 7873 +FE1C2 \uDBB8\uDDC2 \xF3\xBE\x87\x82 MOUSE 347 F7F2 E5C2 7874 ECF2 [ネズミ] 83 F994 E053 7874 +FE1C3 \uDBB8\uDDC3 \xF3\xBE\x87\x83 WHALE 246 F648 E470 7529 EB48 [クジラ] 84 F995 E054 7529 +FE1C4 \uDBB8\uDDC4 \xF3\xBE\x87\x84 MONKEY FACE 249 F6B2 E4D9 7634 EBB2 〓 99 F749 E109 7634 +FE1C5 \uDBB8\uDDC5 \xF3\xBE\x87\x85 OCTOPUS 352 F7F7 E5C7 7879 ECF7 [タコ] 100 F74A E10A 7879 +FE1C6 \uDBB8\uDDC6 \xF3\xBE\x87\x86 SPIRAL SHELL 485 F3C0 EAEC 7A42 EDC0 [巻貝] 412 FB82 E441 7A42 +FE1C7 \uDBB8\uDDC7 \xF3\xBE\x87\x87 DOLPHIN 713 F3DC EB1B 7A5E EDDC [イルカ] 455 FBC0 E520 7A5E +FE1C8 \uDBB8\uDDC8 \xF3\xBE\x87\x88 BIRD 78 F6B9 E4E0 763B EBB9 368 F9F4 E74F 763B 456 FBC1 E521 7D36 +FE1C9 \uDBB8\uDDC9 \xF3\xBE\x87\x89 TROPICAL FISH 715 F3DE EB1D 7A60 EDDE 370 F9F6 E751 7A60 457 FBC2 E522 7A60 +FE1CA \uDBB8\uDDCA \xF3\xBE\x87\x8A HAMSTER 〓 〓 459 FBC4 E524 7D69 +FE1CB \uDBB8\uDDCB \xF3\xBE\x87\x8B CENTIPEDE 716 F3DF EB1E 7A61 EDDF [ゲジゲジ] 460 FBC5 E525 7A61 +FE1CC \uDBB8\uDDCC \xF3\xBE\x87\x8C ELEPHANT 717 F3E0 EB1F 7A62 EDE0 [ゾウ] 461 FBC6 E526 7A62 +FE1CD \uDBB8\uDDCD \xF3\xBE\x87\x8D KOALA 718 F3E1 EB20 7A63 EDE1 [コアラ] 462 FBC7 E527 7A63 +FE1CE \uDBB8\uDDCE \xF3\xBE\x87\x8E MONKEY 249 F6B2 E4D9 7634 EBB2 [サル] 463 FBC8 E528 7D45 +FE1CF \uDBB8\uDDCF \xF3\xBE\x87\x8F SHEEP 192 F667 E48F 7548 EB67 [ヒツジ] 464 FBC9 E529 7D40 +FE1D0 \uDBB8\uDDD0 \xF3\xBE\x87\x90 FOX 134 F6BA E4E1 763C EBBA 100 F945 E6A1 763C 465 FBCA E52A 7D3D +FE1D1 \uDBB8\uDDD1 \xF3\xBE\x87\x91 COW 719 F3E2 EB21 7A64 EDE2 [牛] 466 FBCB E52B 7A64 +FE1D2 \uDBB8\uDDD2 \xF3\xBE\x87\x92 RABBIT 247 F6B0 E4D7 7632 EBB0 [ウサギ] 467 FBCC E52C 7632 +FE1D3 \uDBB8\uDDD3 \xF3\xBE\x87\x93 SNAKE 720 F3E3 EB22 7A65 EDE3 [ヘビ] 468 FBCD E52D 7A65 +FE1D4 \uDBB8\uDDD4 \xF3\xBE\x87\x94 CHICKEN 721 F3E4 EB23 7A66 EDE4 [ニワトリ] 469 FBCE E52E 7A66 +FE1D5 \uDBB8\uDDD5 \xF3\xBE\x87\x95 BOAR 722 F3E5 EB24 7A67 EDE5 [イノシシ] 470 FBCF E52F 7A67 +FE1D6 \uDBB8\uDDD6 \xF3\xBE\x87\x96 CAMEL 723 F3E6 EB25 7A68 EDE6 [ラクダ] 471 FBD0 E530 7A68 +FE1D7 \uDBB8\uDDD7 \xF3\xBE\x87\x97 FROG 250 F6B3 E4DA 7635 EBB3 [カエル] 472 FBD1 E531 7635 +FE1D8 \uDBB8\uDDD8 \xF3\xBE\x87\x98 POODLE 74 F6B8 E4DF 763A EBB8 100 F945 E6A1 763C 82 F993 E052 763C +FE1D9 \uDBB8\uDDD9 \xF3\xBE\x87\x99 BLOWFISH 242 F6AC E4D3 762E EBAC 370 F9F6 E751 7A60 25 F959 E019 7D41 +FE1DA \uDBB8\uDDDA \xF3\xBE\x87\x9A ANT 253 F6B6 E4DD 7638 EBB6 [アリ] [アリ] +FE1DB \uDBB8\uDDDB \xF3\xBE\x87\x9B DOG PRINTS 276 F6C7 E4EE 7649 EBC7 91 F8F9 E698 7A6D 477 FBD6 E536 7A6D +FE1DC \uDBB8\uDDDC \xF3\xBE\x87\x9C TURTLE 365 F347 E5D4 7928 ED47 [カメ] [カメ] +FE1DD \uDBB8\uDDDD \xF3\xBE\x87\x9D HATCHING CHICK 372 F34E E5DB 792F ED4E 368 F9F4 E74F 763B 458 FBC3 E523 763B +FE1DE \uDBB8\uDDDE \xF3\xBE\x87\x9E CHINESE ZODIAC DRAGON 749 F443 EB3F 7B24 EE43 [辰] [辰] +FE1DF \uDBB8\uDDDF \xF3\xBE\x87\x9F PANDA 756 F44A EB46 7B2B EE4A [パンダ] [パンダ] +FE1E0 \uDBB8\uDDE0 \xF3\xBE\x87\xA0 PIGS NOSE 758 F44C EB48 7B2D EE4C 374 F9FA E755 7639 101 F74B E10B 7639 +FE1E1 \uDBB8\uDDE1 \xF3\xBE\x87\xA1 HONEY BEE 773 F45B EB57 7B3C EE5B [ミツバチ] [ミツバチ] +FE1E2 \uDBB8\uDDE2 \xF3\xBE\x87\xA2 LADYBUG 774 F45C EB58 7B3D EE5C [てんとう虫] [てんとう虫] +FE1E3 \uDBB8\uDDE3 \xF3\xBE\x87\xA3 CRAB 195 F66A E492 754B EB6A [カニ] [カニ] +FE320 \uDBB8\uDF20 \xF3\xBE\x8C\xA0 ANGRY FACE 258 F64A E472 752B EB4A 141 F996 E6F1 752B 89 F99A E059 752B +FE321 \uDBB8\uDF21 \xF3\xBE\x8C\xA1 ANGUISHED FACE 789 F46B EB67 7B4C EE6B 143 F998 E6F3 7977 350 FB43 E403 7974 +FE322 \uDBB8\uDF22 \xF3\xBE\x8C\xA2 ASTONISHED FACE 451 F39E EACA 797E ED9E 144 F999 E6F4 784D 363 FB50 E410 797E +FE323 \uDBB8\uDF23 \xF3\xBE\x8C\xA3 DISAPPOINTED FACE 441 F394 EAC0 7974 ED94 142 F997 E6F2 7974 88 F999 E058 7977 +FE324 \uDBB8\uDF24 \xF3\xBE\x8C\xA4 DIZZY FACE 327 F7CB E5AE 784D ECCB 144 F999 E6F4 784D 353 FB46 E406 7976 +FE325 \uDBB8\uDF25 \xF3\xBE\x8C\xA5 EXASPERATED FACE 452 F39F EACB 7A21 ED9F 324 F9C8 E723 7878 362 FB4F E40F 7D50 +FE326 \uDBB8\uDF26 \xF3\xBE\x8C\xA6 EXPRESSIONLESS FACE 450 F39D EAC9 797D ED9D 326 F9CA E725 797D 361 FB4E E40E 797D +FE327 \uDBB8\uDF27 \xF3\xBE\x8C\xA7 FACE WITH HEART SHAPED EYES 349 F7F4 E5C4 7876 ECF4 327 F9CB E726 7876 96 F746 E106 7876 +FE328 \uDBB8\uDF28 \xF3\xBE\x8C\xA8 FACE WITH LOOK OF TRIUMPH 442 F395 EAC1 7975 ED95 372 F9F8 E753 7B65 351 FB44 E404 7975 +FE329 \uDBB8\uDF29 \xF3\xBE\x8C\xA9 FACE WITH STUCK OUT TONGUE 264 F6C0 E4E7 7642 EBC0 329 F9CD E728 7642 95 F745 E105 7642 +FE32A \uDBB8\uDF2A \xF3\xBE\x8C\xAA FACE WITH STUCK OUT TONGUE 2 264 F6C0 E4E7 7642 EBC0 329 F9CD E728 7642 356 FB49 E409 7D47 +FE32B \uDBB8\uDF2B \xF3\xBE\x8C\xAB FACE WITH YUMMY LOOK 454 F3A1 EACD 7A23 EDA1 371 F9F7 E752 7A23 86 F997 E056 7A23 +FE32C \uDBB8\uDF2C \xF3\xBE\x8C\xAC FACE WITH PUCKERED LIPS 456 F3A3 EACF 7A25 EDA3 327 F9CB E726 7876 371 FB58 E418 7A25 +FE32D \uDBB8\uDF2D \xF3\xBE\x8C\xAD FACE WITH PUCKERED LIPS 2 455 F3A2 EACE 7A24 EDA2 327 F9CB E726 7876 370 FB57 E417 7A24 +FE32E \uDBB8\uDF2E \xF3\xBE\x8C\xAE FACE WITH A MASK 448 F39B EAC7 797B ED9B [風邪ひき] 359 FB4C E40C 797B +FE32F \uDBB8\uDF2F \xF3\xBE\x8C\xAF FEVERISH FACE 449 F39C EAC8 797C ED9C 331 F9CF E72A 7E35 360 FB4D E40D 797C +FE330 \uDBB8\uDF30 \xF3\xBE\x8C\xB0 HAPPY FACE 257 F649 E471 752A EB49 140 F995 E6F0 752A 87 F998 E057 752A +FE331 \uDBB8\uDF31 \xF3\xBE\x8C\xB1 HAPPY FACE 2 257+330 F649+F7CE E471+E5B1 752A+7850 EB49+ECCE 323 F9C7 E722 7E34 368+319 FB55+F9D1 E415+E331 7D46+7850 +FE332 \uDBB8\uDF32 \xF3\xBE\x8C\xB2 HAPPY FACE 3 446 F399 EAC5 7979 ED99 331 F9CF E72A 7E35 357 FB4A E40A 7979 +FE333 \uDBB8\uDF33 \xF3\xBE\x8C\xB3 HAPPY FACE 4 814 F485 EB80 7B65 EE85 372 F9F8 E753 7B65 351 FB44 E404 7975 +FE334 \uDBB8\uDF34 \xF3\xBE\x8C\xB4 HAPPY FACE 5 786 F468 EB64 7B49 EE68 331 F9CF E72A 7E35 365 FB52 E412 7B49 +FE335 \uDBB8\uDF35 \xF3\xBE\x8C\xB5 HAPPY FACE 6 454 F3A1 EACD 7A23 EDA1 140 F995 E6F0 752A 86 F997 E056 7A23 +FE336 \uDBB8\uDF36 \xF3\xBE\x8C\xB6 HAPPY FACE 7 68 F6D4 E4FB 7656 EBD4 140 F995 E6F0 752A 86 F997 E056 7A23 +FE337 \uDBB8\uDF37 \xF3\xBE\x8C\xB7 HAPPY FACE 8 454 F3A1 EACD 7A23 EDA1 140 F995 E6F0 752A 367 FB54 E414 7D51 +FE338 \uDBB8\uDF38 \xF3\xBE\x8C\xB8 HAPPY FACE 9 257 F649 E471 752A EB49 140 F995 E6F0 752A 368 FB55 E415 7D46 +FE339 \uDBB8\uDF39 \xF3\xBE\x8C\xB9 LITTLE CRYING FACE 791 F46D EB69 7B4E EE6D 335 F9D3 E72E 7B4E 366 FB53 E413 7B4E +FE33A \uDBB8\uDF3A \xF3\xBE\x8C\xBA LOUDLY CRYING FACE 259 F64B E473 752C EB4B 334 F9D2 E72D 752C 364 FB51 E411 752C +FE33B \uDBB8\uDF3B \xF3\xBE\x8C\xBB PALE FACE 447 F39A EAC6 797A ED9A 376 F9FC E757 7877 358 FB4B E40B 797A +FE33C \uDBB8\uDF3C \xF3\xBE\x8C\xBC PERSEVERING FACE 443 F396 EAC2 7976 ED96 332 F9D0 E72B 7976 353 FB46 E406 7976 +FE33D \uDBB8\uDF3D \xF3\xBE\x8C\xBD POUTING FACE 779 F461 EB5D 7B42 EE61 325 F9C9 E724 7B42 369 FB56 E416 7B42 +FE33E \uDBB8\uDF3E \xF3\xBE\x8C\xBE RELIEVED FACE 446 F399 EAC5 7979 ED99 322 F9C6 E721 7979 357 FB4A E40A 7979 +FE33F \uDBB8\uDF3F \xF3\xBE\x8C\xBF SAD FACE 444 F397 EAC3 7977 ED97 143 F998 E6F3 7977 354 FB47 E407 7D4F +FE340 \uDBB8\uDF40 \xF3\xBE\x8D\x80 SAD FACE 2 441 F394 EAC0 7974 ED94 321 F9C5 E720 7E33 350 FB43 E403 7974 +FE341 \uDBB8\uDF41 \xF3\xBE\x8D\x81 SHOCKED FACE WITH SCREAM 350 F7F5 E5C5 7877 ECF5 376 F9FC E757 7877 97 F747 E107 7877 +FE342 \uDBB8\uDF42 \xF3\xBE\x8D\x82 SLEEPY FACE 445 F398 EAC4 7978 ED98 157 F9A6 E701 752E 355 FB48 E408 7978 +FE343 \uDBB8\uDF43 \xF3\xBE\x8D\x83 SMIRKY FACE 440 F393 EABF 7973 ED93 333 F9D1 E72C 7973 349 FB42 E402 7973 +FE344 \uDBB8\uDF44 \xF3\xBE\x8D\x84 TEARY FACE 351 F7F6 E5C6 7878 ECF6 324 F9C8 E723 7878 98 F748 E108 7878 +FE345 \uDBB8\uDF45 \xF3\xBE\x8D\x85 TEARY FACE 2 351 F7F6 E5C6 7878 ECF6 324 F9C8 E723 7878 348 FB41 E401 7D4B +FE346 \uDBB8\uDF46 \xF3\xBE\x8D\x86 TIRED FACE 260 F64C E474 752D EB4C 332 F9D0 E72B 7976 353 FB46 E406 7976 +FE347 \uDBB8\uDF47 \xF3\xBE\x8D\x87 WINKING FACE 348 F7F3 E5C3 7875 ECF3 330 F9CE E729 7875 352 FB45 E405 7875 +FE348 \uDBB8\uDF48 \xF3\xBE\x8D\x88 CAT FACE 1 783 F465 EB61 7B46 EE65 140 F995 E6F0 752A 87 F998 E057 752A +FE349 \uDBB8\uDF49 \xF3\xBE\x8D\x89 CAT FACE 2 813 F484 EB7F 7B64 EE84 372 F9F8 E753 7B65 351 FB44 E404 7975 +FE34A \uDBB8\uDF4A \xF3\xBE\x8D\x8A CAT FACE 3 785 F467 EB63 7B48 EE67 331 F9CF E72A 7E35 365 FB52 E412 7B49 +FE34B \uDBB8\uDF4B \xF3\xBE\x8D\x8B CAT FACE 4 782 F464 EB60 7B45 EE64 327 F9CB E726 7876 371 FB58 E418 7A25 +FE34C \uDBB8\uDF4C \xF3\xBE\x8D\x8C CAT FACE 5 787 F469 EB65 7B4A EE69 327 F9CB E726 7876 96 F746 E106 7876 +FE34D \uDBB8\uDF4D \xF3\xBE\x8D\x8D CAT FACE 6 790 F46C EB68 7B4D EE6C 335 F9D3 E72E 7B4E 366 FB53 E413 7B4E +FE34E \uDBB8\uDF4E \xF3\xBE\x8D\x8E CAT FACE 7 780 F462 EB5E 7B43 EE62 325 F9C9 E724 7B42 369 FB56 E416 7B42 +FE34F \uDBB8\uDF4F \xF3\xBE\x8D\x8F CAT FACE 8 792 F46E EB6A 7B4F EE6E 372 F9F8 E753 7B65 351 FB44 E404 7975 +FE350 \uDBB8\uDF50 \xF3\xBE\x8D\x90 CAT FACE 9 788 F46A EB66 7B4B EE6A 143 F998 E6F3 7977 350 FB43 E403 7974 +FE351 \uDBB8\uDF51 \xF3\xBE\x8D\x91 FACE WITH NO GOOD GESTURE 464 F3AB EAD7 7A2D EDAB 336 F9D4 E72F 7E36 382 FB63 E423 7A2D +FE352 \uDBB8\uDF52 \xF3\xBE\x8D\x92 FACE WITH OK GESTURE 465 F3AC EAD8 7A2E EDAC 135 F9B0 E70B 784C 383 FB64 E424 7A2E +FE353 \uDBB8\uDF53 \xF3\xBE\x8D\x93 BOWING FACE 466 F3AD EAD9 7A2F EDAD m(_ _)m 385 FB66 E426 7A2F +FE354 \uDBB8\uDF54 \xF3\xBE\x8D\x94 SEE NO EVIL MONKEY 766 F454 EB50 7B35 EE54 (/_\) (/_\) +FE355 \uDBB8\uDF55 \xF3\xBE\x8D\x95 SPEAK NO EVIL MONEY 767 F455 EB51 7B36 EE55 (・×・) (・×・) +FE356 \uDBB8\uDF56 \xF3\xBE\x8D\x96 HEAR NO EVIL MONKEY 768 F456 EB52 7B37 EE56 |(・×・)| |(・×・)| +FE357 \uDBB8\uDF57 \xF3\xBE\x8D\x97 PERSON RAISING ONE HAND 819 F48A EB85 7B6A EE8A (^-^)/ 18 F952 E012 7846 +FE358 \uDBB8\uDF58 \xF3\xBE\x8D\x98 PERSON RAISING BOTH HANDS 820 F48B EB86 7B6B EE8B \(^o^)/ 386 FB67 E427 7B6B +FE359 \uDBB8\uDF59 \xF3\xBE\x8D\x99 PERSON FROWNING 821 F48C EB87 7B6C EE8C 143 F998 E6F3 7977 350 FB43 E403 7974 +FE35A \uDBB8\uDF5A \xF3\xBE\x8D\x9A PERSON MAKING POUTING FACE 822 F48D EB88 7B6D EE8D 141 F996 E6F1 752B 369 FB56 E416 7B42 +FE35B \uDBB8\uDF5B \xF3\xBE\x8D\x9B PERSON WITH FOLDED HANDS 459 F3A6 EAD2 7A28 EDA6 (>人<) 376 FB5D E41D 7A28 +FE35C \uDBB8\uDF5C \xF3\xBE\x8D\x9C COOL FACE B-) B-) B-) +FE35D \uDBB8\uDF5D \xF3\xBE\x8D\x9D HUG FACE \(^-^)/ \(^-^)/ \(^-^)/ +FE35E \uDBB8\uDF5E \xF3\xBE\x8D\x9E GEEK 8-| 8-| 8-| +FE35F \uDBB8\uDF5F \xF3\xBE\x8D\x9F THINKING [考え中] [考え中] [考え中] +FE360 \uDBB8\uDF60 \xF3\xBE\x8D\xA0 BOUNCING HAPPY [やったー] [やったー] [やったー] +FE361 \uDBB8\uDF61 \xF3\xBE\x8D\xA1 FACE WITH ROLLING EYES [クラクラ] [クラクラ] [クラクラ] +FE362 \uDBB8\uDF62 \xF3\xBE\x8D\xA2 FACE WITH SLANTED MOUTH [ムムム] [ムムム] [ムムム] +FE363 \uDBB8\uDF63 \xF3\xBE\x8D\xA3 FACE WITH UNBALANCED EYES [エッ?] [エッ?] [エッ?] +FE364 \uDBB8\uDF64 \xF3\xBE\x8D\xA4 UPSIDE DOWN FACE [逆立ち] [逆立ち] [逆立ち] +FE365 \uDBB8\uDF65 \xF3\xBE\x8D\xA5 INJURED FACE [怪我をした顔] [怪我をした顔] [怪我をした顔] +FE366 \uDBB8\uDF66 \xF3\xBE\x8D\xA6 NERVOUS FACE [心配した顔] [心配した顔] [心配した顔] +FE367 \uDBB8\uDF67 \xF3\xBE\x8D\xA7 SYMPATHETIC FACE [同情した顔] [同情した顔] [同情した顔] +FE368 \uDBB8\uDF68 \xF3\xBE\x8D\xA8 THIN FACE [細い顔] [細い顔] [細い顔] +FE369 \uDBB8\uDF69 \xF3\xBE\x8D\xA9 ROBOT [ロボット] [ロボット] [ロボット] +FE4B0 \uDBB9\uDCB0 \xF3\xBE\x92\xB0 HOUSE 112 F684 E4AB 7564 EB84 38 F8C4 E663 7564 54 F976 E036 7564 +FE4B1 \uDBB9\uDCB1 \xF3\xBE\x92\xB1 HOME 514 F7E0 EB09 7862 ECE0 38 F8C4 E663 7564 54 F976 E036 7564 +FE4B2 \uDBB9\uDCB2 \xF3\xBE\x92\xB2 OFFICE BUILDING 156 F686 E4AD 7566 EB86 39 F8C5 E664 7566 56 F978 E038 7566 +FE4B3 \uDBB9\uDCB3 \xF3\xBE\x92\xB3 POST OFFICE 375 F351 E5DE 7932 ED51 40 F8C6 E665 7932 173 F794 E153 7932 +FE4B4 \uDBB9\uDCB4 \xF3\xBE\x92\xB4 HOSPITAL 376 F352 E5DF 7933 ED52 41 F8C7 E666 7933 175 F796 E155 7933 +FE4B5 \uDBB9\uDCB5 \xF3\xBE\x92\xB5 BANK 212 F683 E4AA 7563 EB83 42 F8C8 E667 7563 167 F78E E14D 7563 +FE4B6 \uDBB9\uDCB6 \xF3\xBE\x92\xB6 ATM 205 F67B E4A3 755C EB7B 43 F8C9 E668 755C 174 F795 E154 755C +FE4B7 \uDBB9\uDCB7 \xF3\xBE\x92\xB7 HOTEL 378 F354 EA81 7935 ED54 44 F8CA E669 7935 178 F799 E158 7935 +FE4B8 \uDBB9\uDCB8 \xF3\xBE\x92\xB8 HOTEL 2 492 F3C7 EAF3 7A49 EDC7 44+139 F8CA+F994 E669+E6EF 7935+7531 424 FBA1 E501 7A49 +FE4B9 \uDBB9\uDCB9 \xF3\xBE\x92\xB9 CONVENIENCE STORE 206 F67C E4A4 755D EB7C 45 F8CB E66A 755D 176 F797 E156 755D +FE4BA \uDBB9\uDCBA \xF3\xBE\x92\xBA SCHOOL 377 F353 EA80 7934 ED53 351 F9E3 E73E 7934 177 F798 E157 7934 +FE4BB \uDBB9\uDCBB \xF3\xBE\x92\xBB CHAPEL 340 F7EB E5BB 786D ECEB [教会] 55 F977 E037 786D +FE4BC \uDBB9\uDCBC \xF3\xBE\x92\xBC FOUNTAIN 360 F342 E5CF 7923 ED42 [噴水] 123 F761 E121 7923 +FE4BD \uDBB9\uDCBD \xF3\xBE\x92\xBD DEPARTMENT STORE 495 F3CA EAF6 7A4C EDCA [デパート] 427 FBA4 E504 7A4C +FE4BE \uDBB9\uDCBE \xF3\xBE\x92\xBE JAPANESE CASTLE 496 F3CB EAF7 7A4D EDCB [城] 428 FBA5 E505 7A4D +FE4BF \uDBB9\uDCBF \xF3\xBE\x92\xBF WESTERN CASTLE 497 F3CC EAF8 7A4E EDCC [城] 429 FBA6 E506 7A4E +FE4C0 \uDBB9\uDCC0 \xF3\xBE\x93\x80 FACTORY 498 F3CD EAF9 7A4F EDCD [工場] 431 FBA8 E508 7A4F +FE4C1 \uDBB9\uDCC1 \xF3\xBE\x93\x81 ANCHOR 211 F682 E4A9 7562 EB82 36 F8C2 E661 7936 182 F7A2 E202 7936 +FE4C2 \uDBB9\uDCC2 \xF3\xBE\x93\x82 RED LANTERN 225 F696 E4BD 7576 EB96 364 F9F0 E74B 794B 281 F9AB E30B 794B +FE4C3 \uDBB9\uDCC3 \xF3\xBE\x93\x83 MOUNT FUJI 342 F7ED E5BD 786F ECED 353 F9E5 E740 786F 59 F97B E03B 786F +FE4C4 \uDBB9\uDCC4 \xF3\xBE\x93\x84 TOKYO TOWER 228 F699 E4C0 7579 EB99 [東京タワー] 432 FBA9 E509 7579 +FE4C5 \uDBB9\uDCC5 \xF3\xBE\x93\x85 BOUTIQUE 109 〓 〓 433 FBAA E50A 7D66 +FE4C6 \uDBB9\uDCC6 \xF3\xBE\x93\x86 STATUE OF LIBERTY 〓 〓 452 FBBD E51D 7D67 +FE4C7 \uDBB9\uDCC7 \xF3\xBE\x93\x87 MAP OF JAPAN 214 F78F E572 776F EC8F [地図] [地図] +FE4C8 \uDBB9\uDCC8 \xF3\xBE\x93\x88 MOYAI 794 F470 EB6C 7B51 EE70 [モアイ] [モアイ] +FE4C9 \uDBB9\uDCC9 \xF3\xBE\x93\x89 WRENCH 152 F7A4 E587 7826 ECA4 313 F9BD E718 7826 [レンチ] +FE4CA \uDBB9\uDCCA \xF3\xBE\x93\x8A HAMMER 356 F7FB E5CB 787D ECFB [ハンマー] 112 F756 E116 787D +FE4CB \uDBB9\uDCCB \xF3\xBE\x93\x8B NUT AND BOLT 123 F79E E581 777E EC9E [ネジ] [ネジ] +FE4CC \uDBB9\uDCCC \xF3\xBE\x93\x8C MENS SHOE 336 F7E7 E5B7 7869 ECE7 92 F8FA E699 7A6E 7 F947 E007 7869 +FE4CD \uDBB9\uDCCD \xF3\xBE\x93\x8D SNEAKER 729 F3EC EB2B 7A6E EDEC 92 F8FA E699 7A6E 7 F947 E007 7869 +FE4CE \uDBB9\uDCCE \xF3\xBE\x93\x8E GLASSES 116 F6D7 E4FE 7659 EBD7 93 F8FB E69A 7659 [メガネ] +FE4CF \uDBB9\uDCCF \xF3\xBE\x93\x8F T-SHIRT 335 F7E6 E5B6 7868 ECE6 303 F9B3 E70E 7868 6 F946 E006 7868 +FE4D0 \uDBB9\uDCD0 \xF3\xBE\x93\x90 JEANS 805 F47B EB77 7B5C EE7B 306 F9B6 E711 7B5C [ジーンズ] +FE4D1 \uDBB9\uDCD1 \xF3\xBE\x93\x91 CROWN 354 F7F9 E5C9 787B ECF9 315 F9BF E71A 787B 104 F74E E10E 787B +FE4D2 \uDBB9\uDCD2 \xF3\xBE\x93\x92 EMBLEM 354 F7F9 E5C9 787B ECF9 315 F9BF E71A 787B 49 F971 E031 7D4C +FE4D3 \uDBB9\uDCD3 \xF3\xBE\x93\x93 NECKTIE 396 F366 EA93 7947 ED66 [ネクタイ] 272 F9A2 E302 7947 +FE4D4 \uDBB9\uDCD4 \xF3\xBE\x93\x94 LADIES HAT 407 F371 EA9E 7952 ED71 [帽子] 294 F9B8 E318 7952 +FE4D5 \uDBB9\uDCD5 \xF3\xBE\x93\x95 DRESS 793 F46F EB6B 7B50 EE6F [ドレス] 295 F9B9 E319 7B50 +FE4D6 \uDBB9\uDCD6 \xF3\xBE\x93\x96 HIGH HEELED SHOE 124 F6F3 E51A 7675 EBF3 55 F8D5 E674 7675 152 F77E E13E 7675 +FE4D7 \uDBB9\uDCD7 \xF3\xBE\x93\x97 MULE 124 F6F3 E51A 7675 EBF3 55 F8D5 E674 7675 296 F9BA E31A 7D39 +FE4D8 \uDBB9\uDCD8 \xF3\xBE\x93\x98 LONG BOOTS 408 F372 EA9F 7953 ED72 [ブーツ] 297 F9BB E31B 7953 +FE4D9 \uDBB9\uDCD9 \xF3\xBE\x93\x99 KIMONO 412 F376 EAA3 7957 ED76 [着物] 303 F9C1 E321 7957 +FE4DA \uDBB9\uDCDA \xF3\xBE\x93\x9A BIKINI 413 F377 EAA4 7958 ED77 [ビキニ] 304 F9C2 E322 7958 +FE4DB \uDBB9\uDCDB \xF3\xBE\x93\x9B WOMANS CLOTHES 301 F6E6 E50D 7668 EBE6 303 F9B3 E70E 7868 6 F946 E006 7868 +FE4DC \uDBB9\uDCDC \xF3\xBE\x93\x9C PURSE 290 F6DD E504 765F EBDD 304 F9B4 E70F 765F [財布] +FE4DD \uDBB9\uDCDD \xF3\xBE\x93\x9D PRIZE BAG 233 F6A0 E4C7 7622 EBA0 310 F9BA E715 7622 137 F76F E12F 7622 +FE4DE \uDBB9\uDCDE \xF3\xBE\x93\x9E CURRENCY EXCHANGE [$¥] [$¥] 163 F78A E149 7D5A +FE4DF \uDBB9\uDCDF \xF3\xBE\x93\x9F STOCK MARKET 373 F34F E5DC 7930 ED4F [株価] 164 F78B E14A 7930 +FE4E0 \uDBB9\uDCE0 \xF3\xBE\x93\xA0 DOLLAR SYMBOL 14 F796 E579 7776 EC96 310 F9BA E715 7622 137 F76F E12F 7622 +FE4E1 \uDBB9\uDCE1 \xF3\xBE\x93\xA1 CREDIT CARD 87 F799 E57C 7779 EC99 [カード] [カード] +FE4E2 \uDBB9\uDCE2 \xF3\xBE\x93\xA2 BILL WITH YEN SIGN 109 F79A E57D 777A EC9A 113 F97A E6D6 777A ¥ +FE4E3 \uDBB9\uDCE3 \xF3\xBE\x93\xA3 DOLLAR BILL 139 F7A2 E585 7824 ECA2 310 F9BA E715 7622 137 F76F E12F 7622 +FE4E4 \uDBB9\uDCE4 \xF3\xBE\x93\xA4 MONEY WITH WINGS 777 F45F EB5B 7B40 EE5F [飛んでいくお金] [飛んでいくお金] +FE4E5 \uDBB9\uDCE5 \xF3\xBE\x93\xA5 FLAG OF JAPAN 237 F6A5 E4CC 7627 EBA5 [日の丸] 434 FBAB E50B 7627 +FE4E6 \uDBB9\uDCE6 \xF3\xBE\x93\xA6 FLAG OF THE USA 90 F790 E573 7770 EC90 [USA] 435 FBAC E50C 7770 +FE4E7 \uDBB9\uDCE7 \xF3\xBE\x93\xA7 FLAG OF FRANCE 499 F3CE EAFA 7A50 EDCE [フランス] 436 FBAD E50D 7A50 +FE4E8 \uDBB9\uDCE8 \xF3\xBE\x93\xA8 FLAG OF GERMANY 700 F3CF EB0E 7A51 EDCF [ドイツ] 437 FBAE E50E 7A51 +FE4E9 \uDBB9\uDCE9 \xF3\xBE\x93\xA9 FLAG OF ITALY 701 F3D0 EB0F 7A52 EDD0 [イタリア] 438 FBAF E50F 7A52 +FE4EA \uDBB9\uDCEA \xF3\xBE\x93\xAA FLAG OF UNITED KINGDOM 702 F3D1 EB10 7A53 EDD1 [イギリス] 439 FBB0 E510 7A53 +FE4EB \uDBB9\uDCEB \xF3\xBE\x93\xAB FLAG OF SPAIN 366 F348 E5D5 7929 ED48 [スペイン] 440 FBB1 E511 7929 +FE4EC \uDBB9\uDCEC \xF3\xBE\x93\xAC FLAG OF RUSSIA 367 F349 E5D6 792A ED49 [ロシア] 441 FBB2 E512 792A +FE4ED \uDBB9\uDCED \xF3\xBE\x93\xAD FLAG OF CHINA 703 F3D2 EB11 7A54 EDD2 [中国] 442 FBB3 E513 7A54 +FE4EE \uDBB9\uDCEE \xF3\xBE\x93\xAE FLAG OF SOUTH KOREA 704 F3D3 EB12 7A55 EDD3 [韓国] 443 FBB4 E514 7A55 +FE4EF \uDBB9\uDCEF \xF3\xBE\x93\xAF CAMERA 94 F6EE E515 7670 EBEE 68 F8E2 E681 7670 8 F948 E008 7670 +FE4F0 \uDBB9\uDCF0 \xF3\xBE\x93\xB0 HANDBAG 83 F674 E49C 7555 EB74 69 F8E3 E682 7555 305 F9C3 E323 7555 +FE4F1 \uDBB9\uDCF1 \xF3\xBE\x93\xB1 POUCH [ふくろ] 168 F951 E6AD 7E2B [ふくろ] +FE4F2 \uDBB9\uDCF2 \xF3\xBE\x93\xB2 BELL 48 F6EB E512 766D EBEB 308 F9B8 E713 766D 307 F9C5 E325 766D +FE4F3 \uDBB9\uDCF3 \xF3\xBE\x93\xB3 DOOR [ドア] 309 F9B9 E714 7E32 [ドア] +FE4F4 \uDBB9\uDCF4 \xF3\xBE\x93\xB4 POOP 283 F6CE E4F5 7650 EBCE [ウンチ] 90 F99B E05A 7650 +FE4F5 \uDBB9\uDCF5 \xF3\xBE\x93\xB5 PISTOL 296 F6E3 E50A 7665 EBE3 [ピストル] 109 F753 E113 7665 +FE4F6 \uDBB9\uDCF6 \xF3\xBE\x93\xB6 FIRE 269 F653 E47B 7534 EB53 [炎] 119 F75D E11D 7534 +FE4F7 \uDBB9\uDCF7 \xF3\xBE\x93\xB7 FORTUNE TELLING 392 F362 EA8F 7943 ED62 [占い] 242 F7DE E23E 7943 +FE4F8 \uDBB9\uDCF8 \xF3\xBE\x93\xB8 CONSTELLATION 392 F362 EA8F 7943 ED62 [占い] 242 F7DE E23E 7943 +FE4F9 \uDBB9\uDCF9 \xF3\xBE\x93\xB9 VIDEO CAMERA 111 F79B E57E 777B EC9B 58 F8D8 E677 7672 61 F97D E03D 7672 +FE4FA \uDBB9\uDCFA \xF3\xBE\x93\xBA KNIFE 114 F79C E57F 777C EC9C [包丁] [包丁] +FE4FB \uDBB9\uDCFB \xF3\xBE\x93\xBB FLASHLIGHT 130 F7A0 E583 7822 ECA0 151 F9A0 E6FB 752F [懐中電灯] +FE4FC \uDBB9\uDCFC \xF3\xBE\x93\xBC BATTERY 135 F7A1 E584 7823 ECA1 [電池] [電池] +FE4FD \uDBB9\uDCFD \xF3\xBE\x93\xBD SCROLL 136 F77B E55F 775C EC7B 166 F9AF E70A 7A74 [スクロール] +FE4FE \uDBB9\uDCFE \xF3\xBE\x93\xBE ELECTRIC PLUG 162 F7A6 E589 7828 ECA6 [コンセント] [コンセント] +FE4FF \uDBB9\uDCFF \xF3\xBE\x93\xBF BOOK 1 97 F782 E565 7762 EC82 70 F8E4 E683 7558 162 F789 E148 7558 +FE500 \uDBB9\uDD00 \xF3\xBE\x94\x80 BOOK 2 100 F783 E566 7763 EC83 70 F8E4 E683 7558 162 F789 E148 7558 +FE501 \uDBB9\uDD01 \xF3\xBE\x94\x81 BOOK 3 101 F784 E567 7764 EC84 70 F8E4 E683 7558 162 F789 E148 7558 +FE502 \uDBB9\uDD02 \xF3\xBE\x94\x82 BOOK 4 102 F785 E568 7765 EC85 70 F8E4 E683 7558 162 F789 E148 7558 +FE503 \uDBB9\uDD03 \xF3\xBE\x94\x83 BOOKS 147 F78C E56F 776C EC8C 70 F8E4 E683 7558 162 F789 E148 7558 +FE504 \uDBB9\uDD04 \xF3\xBE\x94\x84 NAME PLATE 145 F6F6 E51D 7678 EBF6 [名札] [名札] +FE505 \uDBB9\uDD05 \xF3\xBE\x94\x85 BATH 369 F34B E5D8 792C ED4B 147 F99C E6F7 7575 153 F780 E13F 792C +FE506 \uDBB9\uDD06 \xF3\xBE\x94\x86 RESTROOM 207 F67D E4A5 755E EB7D 49 F8CF E66E 755E 171 F792 E151 755E +FE507 \uDBB9\uDD07 \xF3\xBE\x94\x87 TOILET 207 F67D E4A5 755E EB7D 49 F8CF E66E 755E 154 F781 E140 7D42 +FE508 \uDBB9\uDD08 \xF3\xBE\x94\x88 WATER CLOSET 207 F67D E4A5 755E EB7D 49 F8CF E66E 755E 279 F9A9 E309 7D63 +FE509 \uDBB9\uDD09 \xF3\xBE\x94\x89 SYRINGE 304 F6E9 E510 766B EBE9 [注射] 149 F77B E13B 766B +FE50A \uDBB9\uDD0A \xF3\xBE\x94\x8A CAPSULE PILL 403 F36D EA9A 794E ED6D [薬] 285 F9AF E30F 794E +FE50B \uDBB9\uDD0B \xF3\xBE\x94\x8B BLOOD TYPE A 724 F3E7 EB26 7A69 EDE7 [A] 473 FBD2 E532 7A69 +FE50C \uDBB9\uDD0C \xF3\xBE\x94\x8C BLOOD TYPE B 725 F3E8 EB27 7A6A EDE8 [B] 474 FBD3 E533 7A6A +FE50D \uDBB9\uDD0D \xF3\xBE\x94\x8D BLOOD TYPE AB 727 F3EA EB29 7A6C EDEA [AB] 475 FBD4 E534 7A6C +FE50E \uDBB9\uDD0E \xF3\xBE\x94\x8E BLOOD TYPE O 726 F3E9 EB28 7A6B EDE9 [O] 476 FBD5 E535 7A6B +FE50F \uDBB9\uDD0F \xF3\xBE\x94\x8F RIBBON 312 F7BC E59F 783E ECBC 71 F8E5 E684 783E 290 F9B4 E314 783E +FE510 \uDBB9\uDD10 \xF3\xBE\x94\x90 PRESENT 144 F6A8 E4CF 762A EBA8 72 F8E6 E685 762A 108 F752 E112 762A +FE511 \uDBB9\uDD11 \xF3\xBE\x94\x91 BIRTHDAY CAKE 313 F7BD E5A0 783F ECBD 73 F8E7 E686 783F 345 F9EB E34B 783F +FE512 \uDBB9\uDD12 \xF3\xBE\x94\x92 CHRISTMAS TREE 234 F6A2 E4C9 7624 EBA2 103 F948 E6A4 7624 51 F973 E033 7624 +FE513 \uDBB9\uDD13 \xF3\xBE\x94\x93 SANTA CLAUS 489 F3C4 EAF0 7A46 EDC4 [サンタ] 419 FB89 E448 7A46 +FE514 \uDBB9\uDD14 \xF3\xBE\x94\x94 TWO JAPANESE FLAGS 370 F34C E5D9 792D ED4C [祝日] 157 F784 E143 792D +FE515 \uDBB9\uDD15 \xF3\xBE\x94\x95 FIREWORKS 357 F7FC E5CC 787E ECFC [花火] 113 F757 E117 787E +FE516 \uDBB9\uDD16 \xF3\xBE\x94\x96 BALLOON 404 F36E EA9B 794F ED6E [風船] 286 F9B0 E310 794F +FE517 \uDBB9\uDD17 \xF3\xBE\x94\x97 PARTY POPPER 405 F36F EA9C 7950 ED6F [クラッカー] 288 F9B2 E312 7950 +FE518 \uDBB9\uDD18 \xF3\xBE\x94\x98 PINE DECORATION 476 F3B7 EAE3 7A39 EDB7 [門松] 401 FB76 E436 7A39 +FE519 \uDBB9\uDD19 \xF3\xBE\x94\x99 GIRLS DOLLS FESTIVAL 477 F3B8 EAE4 7A3A EDB8 [ひな祭り] 403 FB78 E438 7A3A +FE51A \uDBB9\uDD1A \xF3\xBE\x94\x9A GRADUATION CAP 478 F3B9 EAE5 7A3B EDB9 [卒業式] 404 FB79 E439 7A3B +FE51B \uDBB9\uDD1B \xF3\xBE\x94\x9B SCHOOL SATCHEL 479 F3BA EAE6 7A3C EDBA [ランドセル] 405 FB7A E43A 7A3C +FE51C \uDBB9\uDD1C \xF3\xBE\x94\x9C CARP STREAMER 480 F3BB EAE7 7A3D EDBB [こいのぼり] 406 FB7B E43B 7A3D +FE51D \uDBB9\uDD1D \xF3\xBE\x94\x9D JAPANESE SPARKLER 484 F3BF EAEB 7A41 EDBF [線香花火] 411 FB81 E440 7A41 +FE51E \uDBB9\uDD1E \xF3\xBE\x94\x9E WIND CHIME 486 F3C1 EAED 7A43 EDC1 [風鈴] 413 FB83 E442 7A43 +FE51F \uDBB9\uDD1F \xF3\xBE\x94\x9F JACK O LANTERN 487 F3C2 EAEE 7A44 EDC2 [ハロウィン] 416 FB86 E445 7A44 +FE520 \uDBB9\uDD20 \xF3\xBE\x94\xA0 DECORATIVE CONFETTI BALL 230 F647 E46F 7528 EB47 [オメデトウ] [オメデトウ] +FE521 \uDBB9\uDD21 \xF3\xBE\x94\xA1 TANABATA TREE 747 F441 EB3D 7B22 EE41 [七夕] [七夕] +FE522 \uDBB9\uDD22 \xF3\xBE\x94\xA2 PAGER 308 F7B8 E59B 783A ECB8 29 F8BB E65A 783A [ポケベル] +FE523 \uDBB9\uDD23 \xF3\xBE\x94\xA3 TELEPHONE 85 F7B3 E596 7835 ECB3 74 F8E8 E687 7835 9 F949 E009 7835 +FE524 \uDBB9\uDD24 \xF3\xBE\x94\xA4 TELEPHONE 2 155 F6F7 E51E 7679 EBF7 74 F8E8 E687 7835 9 F949 E009 7835 +FE525 \uDBB9\uDD25 \xF3\xBE\x94\xA5 MOBILE PHONE 161 F7A5 E588 7827 ECA5 75 F8E9 E688 7827 10 F94A E00A 7827 +FE526 \uDBB9\uDD26 \xF3\xBE\x94\xA6 PHONE WITH ARROW 513 F7DF EB08 7861 ECDF 105 F972 E6CE 7861 94 F744 E104 7861 +FE527 \uDBB9\uDD27 \xF3\xBE\x94\xA7 MEMO 395 F365 EA92 7946 ED65 76 F8EA E689 7946 271 F9A1 E301 7946 +FE528 \uDBB9\uDD28 \xF3\xBE\x94\xA8 FAX 166 F6F9 E520 767B EBF9 107 F974 E6D0 767B 11 F94B E00B 767B +FE529 \uDBB9\uDD29 \xF3\xBE\x94\xA9 ENVELOPE 108 F6FA E521 767C EBFA 110 F977 E6D3 767C 93 F743 E103 7B47 +FE52A \uDBB9\uDD2A \xF3\xBE\x94\xAA ENVELOPE 2 151 F7AE E591 7830 ECAE 106 F973 E6CF 7B47 93 F743 E103 7B47 +FE52B \uDBB9\uDD2B \xF3\xBE\x94\xAB ENVELOPE WITH ARROW 784 F466 EB62 7B47 EE66 106 F973 E6CF 7B47 93 F743 E103 7B47 +FE52C \uDBB9\uDD2C \xF3\xBE\x94\xAC MAILBOX 129 F6F4 E51B 7676 EBF4 40 F8C6 E665 7932 91 F741 E101 7D3C +FE52D \uDBB9\uDD2D \xF3\xBE\x94\xAD MAILBOX 2 515 F7E1 EB0A 7863 ECE1 40 F8C6 E665 7932 91 F741 E101 7D3C +FE52E \uDBB9\uDD2E \xF3\xBE\x94\xAE POSTBOX 129 F6F4 E51B 7676 EBF4 40 F8C6 E665 7932 92 F742 E102 7676 +FE52F \uDBB9\uDD2F \xF3\xBE\x94\xAF MEGAPHONE 13 F6EA E511 766C EBEA [スピーカ] 156 F783 E142 7D24 +FE530 \uDBB9\uDD30 \xF3\xBE\x94\xB0 LOUD SPEAKER 13 F6EA E511 766C EBEA [スピーカ] 293 F9B7 E317 766C +FE531 \uDBB9\uDD31 \xF3\xBE\x94\xB1 SATELLITE ANTENNA 210 F681 E4A8 7561 EB81 [アンテナ] 165 F78C E14B 7561 +FE532 \uDBB9\uDD32 \xF3\xBE\x94\xB2 DIALOG BUBBLE 86 F6D6 E4FD 7658 EBD6 [フキダシ] [フキダシ] +FE533 \uDBB9\uDD33 \xF3\xBE\x94\xB3 OUTBOX TRAY 153 F7AF E592 7831 ECAF [送信BOX] [送信BOX] +FE534 \uDBB9\uDD34 \xF3\xBE\x94\xB4 INBOX TRAY 154 F7B0 E593 7832 ECB0 [受信BOX] [受信BOX] +FE535 \uDBB9\uDD35 \xF3\xBE\x94\xB5 PACKAGE 165 F6F8 E51F 767A EBF8 72 F8E6 E685 762A 108 F752 E112 762A +FE536 \uDBB9\uDD36 \xF3\xBE\x94\xB6 BLACK NIB 508 F7DA EB03 785C ECDA 169 F952 E6AE 785C [ペン] +FE537 \uDBB9\uDD37 \xF3\xBE\x94\xB7 CHAIR [いす] 171 F956 E6B2 7D57 121 F75F E11F 7D56 +FE538 \uDBB9\uDD38 \xF3\xBE\x94\xB8 PC 337 F7E8 E5B8 786A ECE8 311 F9BB E716 786A 12 F94C E00C 786A +FE539 \uDBB9\uDD39 \xF3\xBE\x94\xB9 PENCIL 149 F679 E4A1 755A EB79 314 F9BE E719 755A 271 F9A1 E301 7946 +FE53A \uDBB9\uDD3A \xF3\xBE\x94\xBA PAPERCLIP 143 F678 E4A0 7559 EB78 337 F9D5 E730 7559 [クリップ] +FE53B \uDBB9\uDD3B \xF3\xBE\x94\xBB BRIEFCASE 359 F341 E5CE 7922 ED41 69 F8E3 E682 7555 120 F75E E11E 7922 +FE53C \uDBB9\uDD3C \xF3\xBE\x94\xBC FLOPPY DISK 126 F79F E582 7821 EC9F [フロッピー] 292 F9B6 E316 7821 +FE53D \uDBB9\uDD3D \xF3\xBE\x94\xBD FLOPPY DISK 2 59 F77E E562 775F EC7E [フロッピー] 292 F9B6 E316 7821 +FE53E \uDBB9\uDD3E \xF3\xBE\x94\xBE BLACK SCISSORS 104 F6EF E516 7671 EBEF 56 F8D6 E675 7671 289 F9B3 E313 7671 +FE53F \uDBB9\uDD3F \xF3\xBE\x94\xBF PUSHPIN 49 F77C E560 775D EC7C φ φ +FE540 \uDBB9\uDD40 \xF3\xBE\x95\x80 DOCUMENT 56 F77D E561 775E EC7D 76 F8EA E689 7946 271 F9A1 E301 7946 +FE541 \uDBB9\uDD41 \xF3\xBE\x95\x81 DOCUMENT 2 103 F786 E569 7766 EC86 76 F8EA E689 7946 271 F9A1 E301 7946 +FE542 \uDBB9\uDD42 \xF3\xBE\x95\x82 CALENDAR 67 F780 E563 7760 EC80 [カレンダー] [カレンダー] +FE543 \uDBB9\uDD43 \xF3\xBE\x95\x83 FILE FOLDER 79 F7AC E58F 782E ECAC [フォルダ] [フォルダ] +FE544 \uDBB9\uDD44 \xF3\xBE\x95\x84 FILE FOLDER 2 84 F7AD E590 782F ECAD [フォルダ] [フォルダ] +FE545 \uDBB9\uDD45 \xF3\xBE\x95\x85 NOTEBOOK 121 F788 E56B 7768 EC88 70 F8E4 E683 7558 162 F789 E148 7558 +FE546 \uDBB9\uDD46 \xF3\xBE\x95\x86 NOTEBOOK 2 122 F677 E49F 7558 EB77 70 F8E4 E683 7558 162 F789 E148 7558 +FE547 \uDBB9\uDD47 \xF3\xBE\x95\x87 NOTEBOOK 3 91 F675 E49D 7556 EB75 70 F8E4 E683 7558 162 F789 E148 7558 +FE548 \uDBB9\uDD48 \xF3\xBE\x95\x88 CLIPBOARD 92 F781 E564 7761 EC81 76 F8EA E689 7946 271 F9A1 E301 7946 +FE549 \uDBB9\uDD49 \xF3\xBE\x95\x89 TEAR OFF CALENDAR 105 F787 E56A 7767 EC87 [カレンダー] [カレンダー] +FE54A \uDBB9\uDD4A \xF3\xBE\x95\x8A CHART 127 F791 E574 7771 EC91 [グラフ] 164 F78B E14A 7930 +FE54B \uDBB9\uDD4B \xF3\xBE\x95\x8B LINE GRAPH CHART 1 128 F792 E575 7772 EC92 [グラフ] 164 F78B E14A 7930 +FE54C \uDBB9\uDD4C \xF3\xBE\x95\x8C LINE GRAPH CHART 2 159 F793 E576 7773 EC93 [グラフ] [グラフ] +FE54D \uDBB9\uDD4D \xF3\xBE\x95\x8D ROLODEX 131 F789 E56C 7769 EC89 70 F8E4 E683 7558 162 F789 E148 7558 +FE54E \uDBB9\uDD4E \xF3\xBE\x95\x8E THUMBTACK 137 F78A E56D 776A EC8A [画びょう] [画びょう] +FE54F \uDBB9\uDD4F \xF3\xBE\x95\x8F LEDGER 142 F78B E56E 776B EC8B 70 F8E4 E683 7558 162 F789 E148 7558 +FE550 \uDBB9\uDD50 \xF3\xBE\x95\x90 RULER 1 157 F78D E570 776D EC8D [定規] [定規] +FE551 \uDBB9\uDD51 \xF3\xBE\x95\x91 RULER 2 158 F67A E4A2 755B EB7A [三角定規] [三角定規] +FE552 \uDBB9\uDD52 \xF3\xBE\x95\x92 BOOKMARK TABS 516 F7E2 EB0B 7864 ECE2 76 F8EA E689 7946 271 F9A1 E301 7946 +FE553 \uDBB9\uDD53 \xF3\xBE\x95\x93 FOOT PRINTS 728 F3EB EB2A 7A6D EDEB 91 F8F9 E698 7A6D 477 FBD6 E536 7A6D +FE7D0 \uDBB9\uDFD0 \xF3\xBE\x9F\x90 RUNNING SHIRT WITH SASH 〓 21 F8B3 E652 7E21 〓 +FE7D1 \uDBB9\uDFD1 \xF3\xBE\x9F\x91 BASEBALL 45 F693 E4BA 7573 EB93 22 F8B4 E653 7573 22 F956 E016 7573 +FE7D2 \uDBB9\uDFD2 \xF3\xBE\x9F\x92 GOLF 306 F7B6 E599 7838 ECB6 23 F8B5 E654 7838 20 F954 E014 7838 +FE7D3 \uDBB9\uDFD3 \xF3\xBE\x9F\x93 TENNIS 220 F690 E4B7 7570 EB90 24 F8B6 E655 7570 21 F955 E015 7570 +FE7D4 \uDBB9\uDFD4 \xF3\xBE\x9F\x94 SOCCER 219 F68F E4B6 756F EB8F 25 F8B7 E656 756F 24 F958 E018 756F +FE7D5 \uDBB9\uDFD5 \xF3\xBE\x9F\x95 SKI 421 F380 EAAC 7960 ED80 26 F8B8 E657 7960 19 F953 E013 7960 +FE7D6 \uDBB9\uDFD6 \xF3\xBE\x9F\x96 BASKETBALL 307 F7B7 E59A 7839 ECB7 27 F8B9 E658 7839 389 FB6A E42A 7839 +FE7D7 \uDBB9\uDFD7 \xF3\xBE\x9F\x97 CHECKERED FLAG 222 F692 E4B9 7572 EB92 28 F8BA E659 7572 140 F772 E132 7572 +FE7D8 \uDBB9\uDFD8 \xF3\xBE\x9F\x98 SNOWBOARDER 221 F691 E4B8 7571 EB91 307 F9B7 E712 7571 [スノボ] +FE7D9 \uDBB9\uDFD9 \xF3\xBE\x9F\x99 RUNNER 218 F643 E46B 7524 EB43 340 F9D8 E733 7524 111 F755 E115 7524 +FE7DA \uDBB9\uDFDA \xF3\xBE\x9F\x9A SURFER 751 F445 EB41 7B26 EE45 307 F9B7 E712 7571 23 F957 E017 7B26 +FE7DB \uDBB9\uDFDB \xF3\xBE\x9F\x9B TROPHY 364 F346 E5D3 7927 ED46 [トロフィー] 139 F771 E131 7927 +FE7DC \uDBB9\uDFDC \xF3\xBE\x9F\x9C HORSE RACING 248 F6B1 E4D8 7633 EBB1 373 F9F9 E754 7633 142 F774 E134 7D44 +FE7DD \uDBB9\uDFDD \xF3\xBE\x9F\x9D FOOTBALL 96 F694 E4BB 7574 EB94 [フットボール] 390 FB6B E42B 7574 +FE7DE \uDBB9\uDFDE \xF3\xBE\x9F\x9E SWIMMER 471 F3B2 EADE 7A34 EDB2 [水泳] 392 FB6D E42D 7A34 +FE7DF \uDBB9\uDFDF \xF3\xBE\x9F\x9F TRAIN 172 F68E E4B5 756E EB8E 30 F8BC E65B 756E 30 F95E E01E 756E +FE7E0 \uDBB9\uDFE0 \xF3\xBE\x9F\xA0 SUBWAY 341 F7EC E5BC 786E ECEC 31 F8BD E65C 786E 399 FB74 E434 786E +FE7E1 \uDBB9\uDFE1 \xF3\xBE\x9F\xA1 METRO SIGN 341 F7EC E5BC 786E ECEC 31 F8BD E65C 786E 399 FB74 E434 786E +FE7E2 \uDBB9\uDFE2 \xF3\xBE\x9F\xA2 BULLET TRAIN 217 F689 E4B0 7569 EB89 32 F8BE E65D 7569 400 FB75 E435 7569 +FE7E3 \uDBB9\uDFE3 \xF3\xBE\x9F\xA3 BULLET TRAIN 2 217 F689 E4B0 7569 EB89 32 F8BE E65D 7569 31 F95F E01F 7D43 +FE7E4 \uDBB9\uDFE4 \xF3\xBE\x9F\xA4 CAR 125 F68A E4B1 756A EB8A 33 F8BF E65E 756A 27 F95B E01B 756A +FE7E5 \uDBB9\uDFE5 \xF3\xBE\x9F\xA5 CAR 2 125 F68A E4B1 756A EB8A 34 F8C0 E65F 7E22 393 FB6E E42E 7D3B +FE7E6 \uDBB9\uDFE6 \xF3\xBE\x9F\xA6 BUS 216 F688 E4AF 7568 EB88 35 F8C1 E660 7568 179 F79A E159 7568 +FE7E7 \uDBB9\uDFE7 \xF3\xBE\x9F\xA7 BUS STOP 209 F680 E4A7 7560 EB80 [バス停] 170 F791 E150 7560 +FE7E8 \uDBB9\uDFE8 \xF3\xBE\x9F\xA8 SHIP 379 F355 EA82 7936 ED55 36 F8C2 E661 7936 182 F7A2 E202 7936 +FE7E9 \uDBB9\uDFE9 \xF3\xBE\x9F\xA9 AIRPLANE 168 F68C E4B3 756C EB8C 37 F8C3 E662 756C 29 F95D E01D 756C +FE7EA \uDBB9\uDFEA \xF3\xBE\x9F\xAA SAILBOAT 169 F68D E4B4 756D EB8D 102 F947 E6A3 756D 28 F95C E01C 756D +FE7EB \uDBB9\uDFEB \xF3\xBE\x9F\xAB BICYCLE 215 F687 E4AE 7567 EB87 318 F9C2 E71D 7567 144 F776 E136 7567 +FE7EC \uDBB9\uDFEC \xF3\xBE\x9F\xAC STATION 795 F471 EB6D 7B52 EE71 [駅] 57 F979 E039 7B52 +FE7ED \uDBB9\uDFED \xF3\xBE\x9F\xAD ROCKET 353 F7F8 E5C8 787A ECF8 [ロケット] 103 F74D E10D 787A +FE7EE \uDBB9\uDFEE \xF3\xBE\x9F\xAE SPEEDBOAT 169 F68D E4B4 756D EB8D 102 F947 E6A3 756D 143 F775 E135 7D3F +FE7EF \uDBB9\uDFEF \xF3\xBE\x9F\xAF TAXI 125 F68A E4B1 756A EB8A 33 F8BF E65E 756A 180 F79B E15A 7D3A +FE7F0 \uDBB9\uDFF0 \xF3\xBE\x9F\xB0 WALKER 800 F476 EB72 7B57 EE76 340 F9D8 E733 7524 181 F7A1 E201 7B57 +FE7F1 \uDBB9\uDFF1 \xF3\xBE\x9F\xB1 TRUCK 148 F68B E4B2 756B EB8B [トラック] 394 FB6F E42F 756B +FE7F2 \uDBB9\uDFF2 \xF3\xBE\x9F\xB2 FIRE ENGINE 472 F3B3 EADF 7A35 EDB3 [消防車] 395 FB70 E430 7A35 +FE7F3 \uDBB9\uDFF3 \xF3\xBE\x9F\xB3 AMBULANCE 473 F3B4 EAE0 7A36 EDB4 [救急車] 396 FB71 E431 7A36 +FE7F4 \uDBB9\uDFF4 \xF3\xBE\x9F\xB4 PATROL CAR 474 F3B5 EAE1 7A37 EDB5 [パトカー] 397 FB72 E432 7A37 +FE7F5 \uDBB9\uDFF5 \xF3\xBE\x9F\xB5 GAS STATION 213 F78E E571 776E EC8E 46 F8CC E66B 776E 58 F97A E03A 776E +FE7F6 \uDBB9\uDFF6 \xF3\xBE\x9F\xB6 PARKING 208 F67E E4A6 755F EB7E 47 F8CD E66C 755F 169 F790 E14F 755F +FE7F7 \uDBB9\uDFF7 \xF3\xBE\x9F\xB7 TRAFFIC LIGHT 99 F642 E46A 7523 EB42 48 F8CE E66D 7523 168 F78F E14E 7523 +FE7F8 \uDBB9\uDFF8 \xF3\xBE\x9F\xB8 CONSTRUCTION 368 F34A E5D7 792B ED4A [工事中] 145 F777 E137 792B +FE7F9 \uDBB9\uDFF9 \xF3\xBE\x9F\xB9 PATROL CARS REVOLVING LIGHT 801 F477 EB73 7B58 EE77 [パトカー] 397 FB72 E432 7A37 +FE7FA \uDBB9\uDFFA \xF3\xBE\x9F\xBA HOT SPRING 224 F695 E4BC 7575 EB95 147 F99C E6F7 7575 125 F763 E123 7575 +FE7FB \uDBB9\uDFFB \xF3\xBE\x9F\xBB CAMP 361 F343 E5D0 7924 ED43 [キャンプ] 124 F762 E122 7924 +FE7FC \uDBB9\uDFFC \xF3\xBE\x9F\xBC AMUSEMENT PARK 〓 60 F8DA E679 7E23 〓 +FE7FD \uDBB9\uDFFD \xF3\xBE\x9F\xBD AMUSEMENT PARK 2 223 F645 E46D 7526 EB45 [観覧車] 126 F764 E124 7526 +FE7FE \uDBB9\uDFFE \xF3\xBE\x9F\xBE ROLLER COASTER 475 F3B6 EAE2 7A38 EDB6 [ジェットコースター] 398 FB73 E433 7A38 +FE7FF \uDBB9\uDFFF \xF3\xBE\x9F\xBF FISHING 752 F446 EB42 7B27 EE46 370 F9F6 E751 7A60 25 F959 E019 7D41 +FE800 \uDBBA\uDC00 \xF3\xBE\xA0\x80 MICROPHONE 289 F6DC E503 765E EBDC 57 F8D7 E676 765E 60 F97C E03C 765E +FE801 \uDBBA\uDC01 \xF3\xBE\xA0\x81 MOVIES 110 F6F0 E517 7672 EBF0 58 F8D8 E677 7672 61 F97D E03D 7672 +FE802 \uDBBA\uDC02 \xF3\xBE\xA0\x82 MOVIE THEATER 110 F6F0 E517 7672 EBF0 58 F8D8 E677 7672 430 FBA7 E507 7D38 +FE803 \uDBBA\uDC03 \xF3\xBE\xA0\x83 HEADPHONE 294 F6E1 E508 7663 EBE1 61 F8DB E67A 7663 280 F9AA E30A 7663 +FE804 \uDBBA\uDC04 \xF3\xBE\xA0\x84 ART 309 F7B9 E59C 783B ECB9 62 F8DC E67B 783B 425 FBA2 E502 783B +FE805 \uDBBA\uDC05 \xF3\xBE\xA0\x85 BLACK SILK HAT 494 F3C9 EAF5 7A4B EDC9 63 F8DD E67C 7A4B 426 FBA3 E503 7A4B +FE806 \uDBBA\uDC06 \xF3\xBE\xA0\x86 EVENT 311 F7BB E59E 783D ECBB 64 F8DE E67D 783D [イベント] +FE807 \uDBBA\uDC07 \xF3\xBE\xA0\x87 TICKET 106 F676 E49E 7557 EB76 65 F8DF E67E 7557 127 F765 E125 7557 +FE808 \uDBBA\uDC08 \xF3\xBE\xA0\x88 MOVIE SHOOTING CLAPBOARD 226 F697 E4BE 7577 EB97 167 F950 E6AC 7577 306 F9C4 E324 7577 +FE809 \uDBBA\uDC09 \xF3\xBE\xA0\x89 PERFORMING ARTS 310 F7BA E59D 783C ECBA [演劇] 426 FBA3 E503 7A4B +FE80A \uDBBA\uDC0A \xF3\xBE\xA0\x8A VIDEO GAME 232 F69F E4C6 7621 EB9F 78 F8EC E68B 7621 [ゲーム] +FE80B \uDBBA\uDC0B \xF3\xBE\xA0\x8B MAHJONG 362 F344 E5D1 7925 ED44 [麻雀] 135 F76D E12D 7925 +FE80C \uDBBA\uDC0C \xF3\xBE\xA0\x8C BULLS EYE 231 F69E E4C5 757E EB9E [的中] 138 F770 E130 757E +FE80D \uDBBA\uDC0D \xF3\xBE\xA0\x8D SLOT MACHINE 229 F646 E46E 7527 EB46 [777] 141 F773 E133 7527 +FE80E \uDBBA\uDC0E \xF3\xBE\xA0\x8E BILLIARDS 470 F3B1 EADD 7A33 EDB1 [ビリヤード] 391 FB6C E42C 7A33 +FE80F \uDBBA\uDC0F \xF3\xBE\xA0\x8F A DIE 170 F6A1 E4C8 7623 EBA1 [サイコロ] [サイコロ] +FE810 \uDBBA\uDC10 \xF3\xBE\xA0\x90 BOWLING 753 F447 EB43 7B28 EE47 [ボーリング] [ボーリング] +FE811 \uDBBA\uDC11 \xF3\xBE\xA0\x91 JAPANESE FLOWER PLAYING CARDS 796 F472 EB6E 7B53 EE72 [花札] [花札] +FE812 \uDBBA\uDC12 \xF3\xBE\xA0\x92 JOKER CARD 797 F473 EB6F 7B54 EE73 [ジョーカー] [ジョーカー] +FE813 \uDBBA\uDC13 \xF3\xBE\xA0\x93 EIGHTH NOTE 343 F7EE E5BE 7870 ECEE 146 F99B E6F6 7870 62 F97E E03E 7870 +FE814 \uDBBA\uDC14 \xF3\xBE\xA0\x94 MULTIPLE MUSICAL NOTES 291 F6DE E505 7660 EBDE 155 F9A4 E6FF 7660 308 F9C6 E326 7660 +FE815 \uDBBA\uDC15 \xF3\xBE\xA0\x95 SAXOPHONE 〓 〓 64 F981 E040 7D55 +FE816 \uDBBA\uDC16 \xF3\xBE\xA0\x96 GUITAR 292 F6DF E506 7661 EBDF [ギター] 65 F982 E041 7661 +FE817 \uDBBA\uDC17 \xF3\xBE\xA0\x97 PIANO 750 F444 EB40 7B25 EE44 [ピアノ] [ピアノ] +FE818 \uDBBA\uDC18 \xF3\xBE\xA0\x98 TRUMPET 469 F3B0 EADC 7A32 EDB0 [トランペット] 66 F983 E042 7A32 +FE819 \uDBBA\uDC19 \xF3\xBE\xA0\x99 VIOLIN 293 F6E0 E507 7662 EBE0 [バイオリン] [バイオリン] +FE81A \uDBBA\uDC1A \xF3\xBE\xA0\x9A MUSICAL SCORE 453 F3A0 EACC 7A22 EDA0 155 F9A4 E6FF 7660 308 F9C6 E326 7660 +FE81B \uDBBA\uDC1B \xF3\xBE\xA0\x9B START SINGING SYMBOL [グラフ] [グラフ] 134 F76C E12C 7D57 +FE81C \uDBBA\uDC1C \xF3\xBE\xA0\x9C TV 288 F6DB E502 765D EBDB 77 F8EB E68A 765D 132 F76A E12A 765D +FE81D \uDBBA\uDC1D \xF3\xBE\xA0\x9D CD 300 F6E5 E50C 7667 EBE5 79 F8ED E68C 7667 128 F766 E126 7667 +FE81E \uDBBA\uDC1E \xF3\xBE\xA0\x9E DVD 300 F6E5 E50C 7667 EBE5 79 F8ED E68C 7667 129 F767 E127 7D49 +FE81F \uDBBA\uDC1F \xF3\xBE\xA0\x9F RADIO 338 F7E9 E5B9 786B ECE9 [ラジオ] 130 F768 E128 786B +FE820 \uDBBA\uDC20 \xF3\xBE\xA0\xA0 VIDEO TAPE 115 F79D E580 777D EC9D [ビデオ] 131 F769 E129 777D +FE821 \uDBBA\uDC21 \xF3\xBE\xA0\xA1 SPEAKER 13 F6EA E511 766C EBEA [スピーカ] 155 F782 E141 7D23 +FE822 \uDBBA\uDC22 \xF3\xBE\xA0\xA2 NEWSPAPER 171 F7A8 E58B 782A ECA8 [新聞] [新聞] +FE823 \uDBBA\uDC23 \xF3\xBE\xA0\xA3 KISS MARK 273 F6C4 E4EB 7646 EBC4 149 F99E E6F9 7646 3 F943 E003 7646 +FE824 \uDBBA\uDC24 \xF3\xBE\xA0\xA4 LOVE LETTER 806 F47C EB78 7B5D EE7C 312 F9BC E717 7B5D 93+310 F743+F9C8 E103+E328 7B47+7B5A +FE825 \uDBBA\uDC25 \xF3\xBE\xA0\xA5 RING 72 F6ED E514 766F EBED 316 F9C0 E71B 766F 52 F974 E034 766F +FE826 \uDBBA\uDC26 \xF3\xBE\xA0\xA6 GEM STONE 72 F6ED E514 766F EBED 316 F9C0 E71B 766F 53 F975 E035 7D35 +FE827 \uDBBA\uDC27 \xF3\xBE\xA0\xA7 KISS 355 F7FA E5CA 787C ECFA 149 F99E E6F9 7646 107 F751 E111 787C +FE828 \uDBBA\uDC28 \xF3\xBE\xA0\xA8 BOUQUET 398 F368 EA95 7949 ED68 [花束] 276 F9A6 E306 7949 +FE829 \uDBBA\uDC29 \xF3\xBE\xA0\xA9 COUPLE 467 F3AE EADA 7A30 EDAE 137 F992 E6ED 7B5A 384 FB65 E425 7A30 +FE82A \uDBBA\uDC2A \xF3\xBE\xA0\xAA WEDDING 340 F7EB E5BB 786D ECEB 〓 408 FB7D E43D 7D4A +FE82B \uDBBA\uDC2B \xF3\xBE\xA0\xAB FREE DIAL [フリーダイヤル] 122 F984 E6DF 7D5D 197 F7B1 E211 7D5C +FE82C \uDBBA\uDC2C \xF3\xBE\xA0\xAC HASH KEY 818 F489 EB84 7B69 EE89 123 F985 E6E0 7B69 196 F7B0 E210 7B69 +FE82D \uDBBA\uDC2D \xF3\xBE\xA0\xAD MOBILE Q 4 F748 E52C 7729 EC48 124 F986 E6E1 7729 [Q] +FE82E \uDBBA\uDC2E \xF3\xBE\xA0\xAE KEYPAD 1 180 F6FB E522 767D EBFB 125 F987 E6E2 767D 208 F7BC E21C 767D +FE82F \uDBBA\uDC2F \xF3\xBE\xA0\xAF KEYPAD 2 181 F6FC E523 767E EBFC 126 F988 E6E3 767E 209 F7BD E21D 767E +FE830 \uDBBA\uDC30 \xF3\xBE\xA0\xB0 KEYPAD 3 182 F740 E524 7721 EC40 127 F989 E6E4 7721 210 F7BE E21E 7721 +FE831 \uDBBA\uDC31 \xF3\xBE\xA0\xB1 KEYPAD 4 183 F741 E525 7722 EC41 128 F98A E6E5 7722 211 F7BF E21F 7722 +FE832 \uDBBA\uDC32 \xF3\xBE\xA0\xB2 KEYPAD 5 184 F742 E526 7723 EC42 129 F98B E6E6 7723 212 F7C0 E220 7723 +FE833 \uDBBA\uDC33 \xF3\xBE\xA0\xB3 KEYPAD 6 185 F743 E527 7724 EC43 130 F98C E6E7 7724 213 F7C1 E221 7724 +FE834 \uDBBA\uDC34 \xF3\xBE\xA0\xB4 KEYPAD 7 186 F744 E528 7725 EC44 131 F98D E6E8 7725 214 F7C2 E222 7725 +FE835 \uDBBA\uDC35 \xF3\xBE\xA0\xB5 KEYPAD 8 187 F745 E529 7726 EC45 132 F98E E6E9 7726 215 F7C3 E223 7726 +FE836 \uDBBA\uDC36 \xF3\xBE\xA0\xB6 KEYPAD 9 188 F746 E52A 7727 EC46 133 F98F E6EA 7727 216 F7C4 E224 7727 +FE837 \uDBBA\uDC37 \xF3\xBE\xA0\xB7 KEYPAD 0 325 F7C9 E5AC 784B ECC9 134 F990 E6EB 784B 217 F7C5 E225 784B +FE838 \uDBBA\uDC38 \xF3\xBE\xA0\xB8 ANTENNA MARK 381 F357 EA84 7938 ED57 [バリ3] 191 F7AB E20B 7938 +FE839 \uDBBA\uDC39 \xF3\xBE\xA0\xB9 VIBRATION MODE 393 F363 EA90 7944 ED63 [マナーモード] 260 F7F0 E250 7944 +FE83A \uDBBA\uDC3A \xF3\xBE\xA0\xBA PHONE OFF 394 F364 EA91 7945 ED64 [ケータイOFF] 261 F7F1 E251 7945 +FE83B \uDBBA\uDC3B \xF3\xBE\xA0\xBB KEYPAD 10 189 F747 E52B 7728 EC47 [10] [10] +FE83C \uDBBA\uDC3C \xF3\xBE\xA0\xBC PDC 150 F7A3 E586 7825 ECA3 [PDC] [PDC] +FE960 \uDBBA\uDD60 \xF3\xBE\xA5\xA0 HAMBURGER 245 F6AF E4D6 7631 EBAF 54 F8D4 E673 7631 122 F760 E120 7631 +FE961 \uDBBA\uDD61 \xF3\xBE\xA5\xA1 RICE BALL 244 F6AE E4D5 7630 EBAE 362 F9EE E749 7630 336 F9E2 E342 7630 +FE962 \uDBBA\uDD62 \xF3\xBE\xA5\xA2 SHORTCAKE 239 F6A9 E4D0 762B EBA9 363 F9EF E74A 762B 70 F987 E046 762B +FE963 \uDBBA\uDD63 \xF3\xBE\xA5\xA3 STEAMING BOWL 333 F7D1 E5B4 7853 ECD1 365 F9F1 E74C 7853 334 F9E0 E340 7853 +FE964 \uDBBA\uDD64 \xF3\xBE\xA5\xA4 BREAD 424 F383 EAAF 7963 ED83 366 F9F2 E74D 7963 327 F9D9 E339 7963 +FE965 \uDBBA\uDD65 \xF3\xBE\xA5\xA5 COOKING 240 F6AA E4D1 762C EBAA [フライパン] 161 F788 E147 762C +FE966 \uDBBA\uDD66 \xF3\xBE\xA5\xA6 SOFT ICE CREAM 425 F384 EAB0 7964 ED84 [ソフトクリーム] 328 F9DA E33A 7964 +FE967 \uDBBA\uDD67 \xF3\xBE\xA5\xA7 FRENCH FRIES 426 F385 EAB1 7965 ED85 [ポテト] 329 F9DB E33B 7965 +FE968 \uDBBA\uDD68 \xF3\xBE\xA5\xA8 DUMPLING 427 F386 EAB2 7966 ED86 [だんご] 330 F9DC E33C 7966 +FE969 \uDBBA\uDD69 \xF3\xBE\xA5\xA9 RICE CRACKER 428 F387 EAB3 7967 ED87 [せんべい] 331 F9DD E33D 7967 +FE96A \uDBBA\uDD6A \xF3\xBE\xA5\xAA COOKED RICE 429 F388 EAB4 7968 ED88 365 F9F1 E74C 7853 332 F9DE E33E 7968 +FE96B \uDBBA\uDD6B \xF3\xBE\xA5\xAB SPAGHETTI 430 F389 EAB5 7969 ED89 [パスタ] 333 F9DF E33F 7969 +FE96C \uDBBA\uDD6C \xF3\xBE\xA5\xAC CURRY AND RICE 431 F38A EAB6 796A ED8A [カレー] 335 F9E1 E341 796A +FE96D \uDBBA\uDD6D \xF3\xBE\xA5\xAD SEAFOOD CASSEROLE 432 F38B EAB7 796B ED8B [おでん] 337 F9E3 E343 796B +FE96E \uDBBA\uDD6E \xF3\xBE\xA5\xAE SUSHI 433 F38C EAB8 796C ED8C [すし] 338 F9E4 E344 796C +FE96F \uDBBA\uDD6F \xF3\xBE\xA5\xAF LUNCHBOX 438 F391 EABD 7971 ED91 [弁当] 346 F9EC E34C 7971 +FE970 \uDBBA\uDD70 \xF3\xBE\xA5\xB0 POT OF FOOD 439 F392 EABE 7972 ED92 [鍋] 347 F9ED E34D 7972 +FE971 \uDBBA\uDD71 \xF3\xBE\xA5\xB1 SHAVED ICE 483 F3BE EAEA 7A40 EDBE [カキ氷] 410 FB80 E43F 7A40 +FE972 \uDBBA\uDD72 \xF3\xBE\xA5\xB2 MEAT ON A BONE 160 F69D E4C4 757D EB9D [肉] [肉] +FE973 \uDBBA\uDD73 \xF3\xBE\xA5\xB3 FISH CAKE WITH SWIRL DESIGN 275 F6C6 E4ED 7648 EBC6 6 F8A4 E643 7522 [なると] +FE974 \uDBBA\uDD74 \xF3\xBE\xA5\xB4 ROASTED SWEET POTATO 744 F3FB EB3A 7A7D EDFB [やきいも] [やきいも] +FE975 \uDBBA\uDD75 \xF3\xBE\xA5\xB5 PIZZA 745 F3FC EB3B 7A7E EDFC [ピザ] [ピザ] +FE976 \uDBBA\uDD76 \xF3\xBE\xA5\xB6 TURKEY LEG 746 F440 EB3C 7B21 EE40 [チキン] [チキン] +FE977 \uDBBA\uDD77 \xF3\xBE\xA5\xB7 ICE CREAM 760 F44E EB4A 7B2F EE4E [アイスクリーム] [アイスクリーム] +FE978 \uDBBA\uDD78 \xF3\xBE\xA5\xB8 DONUT 761 F44F EB4B 7B30 EE4F [ドーナツ] [ドーナツ] +FE979 \uDBBA\uDD79 \xF3\xBE\xA5\xB9 COOKIE 762 F450 EB4C 7B31 EE50 [クッキー] [クッキー] +FE97A \uDBBA\uDD7A \xF3\xBE\xA5\xBA CHOCOLATE BAR 763 F451 EB4D 7B32 EE51 [チョコ] [チョコ] +FE97B \uDBBA\uDD7B \xF3\xBE\xA5\xBB CANDY 764 F452 EB4E 7B33 EE52 [キャンディ] [キャンディ] +FE97C \uDBBA\uDD7C \xF3\xBE\xA5\xBC LOLLYPOP 765 F453 EB4F 7B34 EE53 [キャンディ] [キャンディ] +FE97D \uDBBA\uDD7D \xF3\xBE\xA5\xBD CUSTARD 772 F45A EB56 7B3B EE5A [プリン] [プリン] +FE97E \uDBBA\uDD7E \xF3\xBE\xA5\xBE HONEY POT 775 F45D EB59 7B3E EE5D [ハチミツ] [ハチミツ] +FE97F \uDBBA\uDD7F \xF3\xBE\xA5\xBF FRIED SHRIMP 798 F474 EB70 7B55 EE74 [エビフライ] [エビフライ] +FE980 \uDBBA\uDD80 \xF3\xBE\xA6\x80 FORK AND KNIFE 146 F685 E4AC 7565 EB85 50 F8D0 E66F 7565 67 F984 E043 7565 +FE981 \uDBBA\uDD81 \xF3\xBE\xA6\x81 HOT BEVERAGE 93 F7B4 E597 7836 ECB4 51 F8D1 E670 7836 69 F986 E045 7836 +FE982 \uDBBA\uDD82 \xF3\xBE\xA6\x82 COCKTAIL GLASS 52 F69B E4C2 757B EB9B 52 F8D2 E671 757B 68 F985 E044 757B +FE983 \uDBBA\uDD83 \xF3\xBE\xA6\x83 BEER 65 F69C E4C3 757C EB9C 53 F8D3 E672 757C 71 F988 E047 757C +FE984 \uDBBA\uDD84 \xF3\xBE\xA6\x84 TEA CUP 423 F382 EAAE 7962 ED82 319 F9C3 E71E 7962 326 F9D8 E338 7962 +FE985 \uDBBA\uDD85 \xF3\xBE\xA6\x85 SAKE BOTTLE AND CUP 400 F36A EA97 794B ED6A 364 F9F0 E74B 794B 281 F9AB E30B 794B +FE986 \uDBBA\uDD86 \xF3\xBE\xA6\x86 WINE GLASS 12 F69A E4C1 757A EB9A 375 F9FB E756 757A 68 F985 E044 757B +FE987 \uDBBA\uDD87 \xF3\xBE\xA6\x87 CLINKING BEER MUGS 401 F36B EA98 794C ED6B 53 F8D3 E672 757C 282 F9AC E30C 794C +FE988 \uDBBA\uDD88 \xF3\xBE\xA6\x88 TROPICAL DRINK 748 F442 EB3E 7B23 EE42 52 F8D2 E671 757B 68 F985 E044 757B +FEAF0 \uDBBA\uDEF0 \xF3\xBE\xAB\xB0 NORTH EAST ARROW 70 F771 E555 7752 EC71 59 F8D9 E678 7752 234 F7D6 E236 7752 +FEAF1 \uDBBA\uDEF1 \xF3\xBE\xAB\xB1 SOUTH EAST ARROW 43 F769 E54D 774A EC69 89 F8F7 E696 774A 236 F7D8 E238 774A +FEAF2 \uDBBA\uDEF2 \xF3\xBE\xAB\xB2 NORTH WEST ARROW 42 F768 E54C 7749 EC68 90 F8F8 E697 7749 235 F7D7 E237 7749 +FEAF3 \uDBBA\uDEF3 \xF3\xBE\xAB\xB3 SOUTH WEST ARROW 71 F772 E556 7753 EC72 104 F949 E6A5 7753 237 F7D9 E239 7753 +FEAF4 \uDBBA\uDEF4 \xF3\xBE\xAB\xB4 RIGHTWARDS ARROW CURVED UPWARDS 731 F3EE EB2D 7A70 EDEE 145 F99A E6F5 7A70 234 F7D6 E236 7752 +FEAF5 \uDBBA\uDEF5 \xF3\xBE\xAB\xB5 RIGHTWARDS ARROW CURVED DOWNWARDS 732 F3EF EB2E 7A71 EDEF 156 F9A5 E700 7A71 236 F7D8 E238 774A +FEAF6 \uDBBA\uDEF6 \xF3\xBE\xAB\xB6 LEFT RIGHT ARROW 808 F47E EB7A 7B5F EE7E 349 F9E1 E73C 7B5F ⇔ +FEAF7 \uDBBA\uDEF7 \xF3\xBE\xAB\xB7 UP DOWN ARROW 809 F480 EB7B 7B60 EE80 350 F9E2 E73D 7B60 ↑↓ +FEAF8 \uDBBA\uDEF8 \xF3\xBE\xAB\xB8 UPWARDS ARROW 29 F75B E53F 773C EC5B [↑] 230 F7D2 E232 773C +FEAF9 \uDBBA\uDEF9 \xF3\xBE\xAB\xB9 DOWNWARDS ARROW 30 F75C E540 773D EC5C [↓] 231 F7D3 E233 773D +FEAFA \uDBBA\uDEFA \xF3\xBE\xAB\xBA RIGHTWARDS ARROW 63 F76E E552 774F EC6E [→] 232 F7D4 E234 774F +FEAFB \uDBBA\uDEFB \xF3\xBE\xAB\xBB LEFTWARDS ARROWS 64 F76F E553 7750 EC6F [←] 233 F7D5 E235 7750 +FEAFC \uDBBA\uDEFC \xF3\xBE\xAB\xBC BLACK RIGHT-POINTING TRIANGLE 6 F74A E52E 772B EC4A [>] 238 F7DA E23A 772B +FEAFD \uDBBA\uDEFD \xF3\xBE\xAB\xBD BLACK LEFT-POINTING TRIANGLE 5 F749 E52D 772A EC49 [<] 239 F7DB E23B 772A +FEAFE \uDBBA\uDEFE \xF3\xBE\xAB\xBE BLACK RIGHT-POINTING DOUBLE TRIANGLE 8 F74C E530 772D EC4C [>>] 240 F7DC E23C 772D +FEAFF \uDBBA\uDEFF \xF3\xBE\xAB\xBF BLACK LEFT-POINTING DOUBLE TRIANGLE 7 F74B E52F 772C EC4B [<<] 241 F7DD E23D 772C +FEB00 \uDBBA\uDF00 \xF3\xBE\xAC\x80 BLACK DOWN-POINTING SMALL TRIANGLE 32 F75E E542 773F EC5E ▼ ▼ +FEB01 \uDBBA\uDF01 \xF3\xBE\xAC\x81 BLACK UP-POINTING SMALL TRIANGLE 33 F75F E543 7740 EC5F ▲ ▲ +FEB02 \uDBBA\uDF02 \xF3\xBE\xAC\x82 BLACK DOWN-POINTING DOUBLE TRIANGLES 34 F760 E544 7741 EC60 ▼ ▼ +FEB03 \uDBBA\uDF03 \xF3\xBE\xAC\x83 BLACK UP-POINTING DOUBLE TRIANGLES 35 F761 E545 7742 EC61 ▲ ▲ +FEB04 \uDBBA\uDF04 \xF3\xBE\xAC\x84 HEAVY EXCLAMATION MARK ORNAMENT 2 F65A E482 753B EB5A 158 F9A7 E702 753B 33 F961 E021 753B +FEB05 \uDBBA\uDF05 \xF3\xBE\xAC\x85 EXCLAMATION QUESTION MARK 733 F3F0 EB2F 7A72 EDF0 159 F9A8 E703 7A72 !? +FEB06 \uDBBA\uDF06 \xF3\xBE\xAC\x86 DOUBLE EXCLAMATION MARK 734 F3F1 EB30 7A73 EDF1 160 F9A9 E704 7A73 !! +FEB07 \uDBBA\uDF07 \xF3\xBE\xAC\x87 WAVY LENGTH MARK 〓 165 F9AE E709 7E2A 〓 +FEB08 \uDBBA\uDF08 \xF3\xBE\xAC\x88 LOOPED LENGTH MARK 735 F3F2 EB31 7A74 EDF2 166 F9AF E70A 7A74 ~ +FEB09 \uDBBA\uDF09 \xF3\xBE\xAC\x89 QUESTION MARK 3 F65B E483 753C EB5B [?] 32 F960 E020 753C +FEB0A \uDBBA\uDF0A \xF3\xBE\xAC\x8A QUESTION MARK 2 3 F65B E483 753C EB5B [?] 324 F9D6 E336 7D22 +FEB0B \uDBBA\uDF0B \xF3\xBE\xAC\x8B EXCLAMATION MARK 2 F65A E482 753B EB5A 158 F9A7 E702 753B 325 F9D7 E337 7D21 +FEB0C \uDBBA\uDF0C \xF3\xBE\xAC\x8C HEAVY BLACK HEART 51 F7B2 E595 7834 ECB2 136 F991 E6EC 7834 34 F962 E022 7834 +FEB0D \uDBBA\uDF0D \xF3\xBE\xAC\x8D HEART 2 803 F479 EB75 7B5A EE79 137 F992 E6ED 7B5A 309 F9C7 E327 795A +FEB0E \uDBBA\uDF0E \xF3\xBE\xAC\x8E HEART 3 265 F64F E477 7530 EB4F 138 F993 E6EE 7530 35 F963 E023 7530 +FEB0F \uDBBA\uDF0F \xF3\xBE\xAC\x8F HEART 4 266 F650 E478 7531 EB50 139 F994 E6EF 7531 309 F9C7 E327 795A +FEB10 \uDBBA\uDF10 \xF3\xBE\xAC\x90 HEART 5 415 F379 EAA6 795A ED79 136 F991 E6EC 7834 309 F9C7 E327 795A +FEB11 \uDBBA\uDF11 \xF3\xBE\xAC\x91 HEART 6 803 F479 EB75 7B5A EE79 137 F992 E6ED 7B5A 310 F9C8 E328 7B5A +FEB12 \uDBBA\uDF12 \xF3\xBE\xAC\x92 HEART 7 272 F6C3 E4EA 7645 EBC3 136 F991 E6EC 7834 311 F9C9 E329 7645 +FEB13 \uDBBA\uDF13 \xF3\xBE\xAC\x93 HEART WITH BLUE COLOR 416 F37A EAA7 795B ED7A 136 F991 E6EC 7834 312 F9CA E32A 795B +FEB14 \uDBBA\uDF14 \xF3\xBE\xAC\x94 HEART WITH GREEN COLOR 417 F37B EAA8 795C ED7B 136 F991 E6EC 7834 313 F9CB E32B 795C +FEB15 \uDBBA\uDF15 \xF3\xBE\xAC\x95 HEART WITH YELLOW COLOR 418 F37C EAA9 795D ED7C 136 F991 E6EC 7834 314 F9CC E32C 795D +FEB16 \uDBBA\uDF16 \xF3\xBE\xAC\x96 HEART WITH PURPLE COLOR 419 F37D EAAA 795E ED7D 136 F991 E6EC 7834 315 F9CD E32D 795E +FEB17 \uDBBA\uDF17 \xF3\xBE\xAC\x97 HEART WITH RIBBON 770 F458 EB54 7B39 EE58 136 F991 E6EC 7834 402 FB77 E437 7B39 +FEB18 \uDBBA\uDF18 \xF3\xBE\xAC\x98 REVOLVING HEARTS 328 F7CC E5AF 784E ECCC 137 F992 E6ED 7B5A 309 F9C7 E327 795A +FEB19 \uDBBA\uDF19 \xF3\xBE\xAC\x99 DECORATIVE DESIGN 1 51 F7B2 E595 7834 ECB2 148 F99D E6F8 7E29 184 F7A4 E204 7D33 +FEB1A \uDBBA\uDF1A \xF3\xBE\xAC\x9A BLACK HEART SUIT 414 F378 EAA5 7959 ED78 80 F8EE E68D 7959 192 F7AC E20C 7959 +FEB1B \uDBBA\uDF1B \xF3\xBE\xAC\x9B BLACK SPADE SUIT 314 F7BE E5A1 7840 ECBE 81 F8EF E68E 7840 194 F7AE E20E 7840 +FEB1C \uDBBA\uDF1C \xF3\xBE\xAC\x9C BLACK DIAMOND SUIT 315 F7BF E5A2 7841 ECBF 82 F8F0 E68F 7841 193 F7AD E20D 7841 +FEB1D \uDBBA\uDF1D \xF3\xBE\xAC\x9D BLACK CLUB SUIT 316 F7C0 E5A3 7842 ECC0 83 F8F1 E690 7842 195 F7AF E20F 7842 +FEB1E \uDBBA\uDF1E \xF3\xBE\xAC\x9E SMOKING SIGN 176 F655 E47D 7536 EB55 66 F8E0 E67F 7536 284 F9AE E30E 7536 +FEB1F \uDBBA\uDF1F \xF3\xBE\xAC\x9F NO SMOKING SIGN 177 F656 E47E 7537 EB56 67 F8E1 E680 7537 188 F7A8 E208 7537 +FEB20 \uDBBA\uDF20 \xF3\xBE\xAC\xA0 WHEELCHAIR SYMBOL 178 F657 E47F 7538 EB57 94 F8FC E69B 7538 190 F7AA E20A 7538 +FEB21 \uDBBA\uDF21 \xF3\xBE\xAC\xA1 FREE SIGN 299 F795 E578 7775 EC95 114 F97B E6D7 7775 [FREE] +FEB22 \uDBBA\uDF22 \xF3\xBE\xAC\xA2 TRIANGULAR FLAG ON POST 730 F3ED EB2C 7A6F EDED 121 F983 E6DE 7A6F [旗] +FEB23 \uDBBA\uDF23 \xF3\xBE\xAC\xA3 WARNING SIGN 1 F659 E481 753A EB59 344 F9DC E737 753A 262 F7F2 E252 753A +FEB24 \uDBBA\uDF24 \xF3\xBE\xAC\xA4 HERE SIGN [ココ] [ココ] 183 F7A3 E203 7D5B +FEB25 \uDBBA\uDF25 \xF3\xBE\xAC\xA5 ADULTS ONLY SIGN 380 F356 EA83 7937 ED56 [18禁] 187 F7A7 E207 7937 +FEB26 \uDBBA\uDF26 \xF3\xBE\xAC\xA6 NO ENTRANCE SIGN 98 F65C E484 753D EB5C 336 F9D4 E72F 7E36 145 F777 E137 792B +FEB27 \uDBBA\uDF27 \xF3\xBE\xAC\xA7 OK SIGN 326 F7CA E5AD 784C ECCA 135 F9B0 E70B 784C 257 F7ED E24D 784C +FEB28 \uDBBA\uDF28 \xF3\xBE\xAC\xA8 NO GOOD SIGN [NG] 336 F9D4 E72F 7E36 [NG] +FEB29 \uDBBA\uDF29 \xF3\xBE\xAC\xA9 COPYRIGHT SIGN 81 F774 E558 7755 EC74 338 F9D6 E731 7755 258 F7EE E24E 7755 +FEB2A \uDBBA\uDF2A \xF3\xBE\xAC\xAA TRADE MARK SIGN 54 F76A E54E 774B EC6A 339 F9D7 E732 774B 478 FBD7 E537 774B +FEB2B \uDBBA\uDF2B \xF3\xBE\xAC\xAB TOP SECRET SIGN 279 F6CA E4F1 764C EBCA 341 F9D9 E734 764C 291 F9B5 E315 764C +FEB2C \uDBBA\uDF2C \xF3\xBE\xAC\xAC BLACK UNIVERSAL RECYCLING SYMBOL 807 F47D EB79 7B5E EE7D 342 F9DA E735 7B5E ↑↓ +FEB2D \uDBBA\uDF2D \xF3\xBE\xAC\xAD REGISTERED SIGN 82 F775 E559 7756 EC75 343 F9DB E736 7756 259 F7EF E24F 7756 +FEB2E \uDBBA\uDF2E \xF3\xBE\xAC\xAE PROHIBITED SIGN [禁] 345 F9DD E738 7E37 [禁] +FEB2F \uDBBA\uDF2F \xF3\xBE\xAC\xAF EMPTY SIGN 387 F35D EA8A 793E ED5D 346 F9DE E739 793E 223 F7CB E22B 793E +FEB30 \uDBBA\uDF30 \xF3\xBE\xAC\xB0 PASSED SIGN [合] 347 F9DF E73A 7E38 [合] +FEB31 \uDBBA\uDF31 \xF3\xBE\xAC\xB1 FULL SIGN 386 F35C EA89 793D ED5C 348 F9E0 E73B 793D 222 F7CA E22A 793D +FEB32 \uDBBA\uDF32 \xF3\xBE\xAC\xB2 VS SIGN 363 F345 E5D2 7926 ED45 [VS] 136 F76E E12E 7926 +FEB33 \uDBBA\uDF33 \xF3\xBE\xAC\xB3 MENS SYMBOL [♂] [♂] 146 F778 E138 7D58 +FEB34 \uDBBA\uDF34 \xF3\xBE\xAC\xB4 WOMENS SYMBOL [♀] [♀] 147 F779 E139 7D59 +FEB35 \uDBBA\uDF35 \xF3\xBE\xAC\xB5 BABY 2 710 F3D9 EB18 7A5B EDD9 [赤ちゃん] 148 F77A E13A 7D54 +FEB36 \uDBBA\uDF36 \xF3\xBE\xAC\xB6 NEW SIGN 334 F7E5 E5B5 7867 ECE5 120 F982 E6DD 7867 198 F7B2 E212 7867 +FEB37 \uDBBA\uDF37 \xF3\xBE\xAC\xB7 UP SIGN 303 F6E8 E50F 766A EBE8 [UP!] 199 F7B3 E213 766A +FEB38 \uDBBA\uDF38 \xF3\xBE\xAC\xB8 COOL SIGN 382 F358 EA85 7939 ED58 [COOL] 200 F7B4 E214 7939 +FEB39 \uDBBA\uDF39 \xF3\xBE\xAC\xB9 EXISTENCE SIGN [有] [有] 201 F7B5 E215 7D5D +FEB3A \uDBBA\uDF3A \xF3\xBE\xAC\xBA NON-EXISTENCE SIGN [無] [無] 202 F7B6 E216 7D5E +FEB3B \uDBBA\uDF3B \xF3\xBE\xAC\xBB MONTHLY SIGN [月] [月] 203 F7B7 E217 7D5F +FEB3C \uDBBA\uDF3C \xF3\xBE\xAC\xBC APPLICATION SIGN [申] [申] 204 F7B8 E218 7D60 +FEB3D \uDBBA\uDF3D \xF3\xBE\xAC\xBD ADVANTAGE SIGN 285 F6D0 E4F7 7652 EBD0 [得] 218 F7C6 E226 7652 +FEB3E \uDBBA\uDF3E \xF3\xBE\xAC\xBE DISCOUNT SIGN 383 F359 EA86 793A ED59 [割] 219 F7C7 E227 793A +FEB3F \uDBBA\uDF3F \xF3\xBE\xAC\xBF SERVICE SIGN 384 F35A EA87 793B ED5A [サービス] 220 F7C8 E228 793B +FEB40 \uDBBA\uDF40 \xF3\xBE\xAD\x80 RESERVED SIGN 388 F35E EA8B 793F ED5E [指] 224 F7CC E22C 793F +FEB41 \uDBBA\uDF41 \xF3\xBE\xAD\x81 IN BUSINESS SIGN 389 F35F EA8C 7940 ED5F [営] 225 F7CD E22D 7940 +FEB42 \uDBBA\uDF42 \xF3\xBE\xAD\x82 TOP WITH UPWARD SIGN [TOP] [TOP] 256 F7EC E24C 7D61 +FEB43 \uDBBA\uDF43 \xF3\xBE\xAD\x83 CELEBRATION SIGN 402 F36C EA99 794D ED6C [祝] 283 F9AD E30D 794D +FEB44 \uDBBA\uDF44 \xF3\xBE\xAD\x84 BLACK CIRCLE MARK 422 F381 EAAD 7961 ED81 99 F944 E6A0 7E24 320 F9D2 E332 7961 +FEB45 \uDBBA\uDF45 \xF3\xBE\xAD\x85 CROSS MARK 61 F76C E550 774D EC6C [×] 321 F9D3 E333 774D +FEB46 \uDBBA\uDF46 \xF3\xBE\xAD\x86 CROSS MARK 2 62 F76D E551 774E EC6D [×] 321 F9D3 E333 774D +FEB47 \uDBBA\uDF47 \xF3\xBE\xAD\x87 INFORMATION SYMBOL 11 F74F E533 7730 EC4F [i] [i] +FEB48 \uDBBA\uDF48 \xF3\xBE\xAD\x88 NO ENTRY SIGN 31 F75D E541 773E EC5D 345 F9DD E738 7E37 [禁止] +FEB49 \uDBBA\uDF49 \xF3\xBE\xAD\x89 HEAVY CHECK MARK 73 F773 E557 7754 EC73 [チェックマーク] [チェックマーク] +FEB4A \uDBBA\uDF4A \xF3\xBE\xAD\x8A HEAVY CHECK MARK 2 132 F77A E55E 775B EC7A [チェックマーク] [チェックマーク] +FEB4B \uDBBA\uDF4B \xF3\xBE\xAD\x8B LINK SYMBOL 164 F7A7 E58A 7829 ECA7 [リンク] [リンク] +FEB4C \uDBBA\uDF4C \xF3\xBE\xAD\x8C FULL BLANK SPACE 173 F7A9 E58C 782B ECA9 〓 〓 +FEB4D \uDBBA\uDF4D \xF3\xBE\xAD\x8D A HALF BLANK SPACE 174 F7AA E58D 782C ECAA 〓 〓 +FEB4E \uDBBA\uDF4E \xF3\xBE\xAD\x8E A QUARTER BLANK SPACE 175 F7AB E58E 782D ECAB 〓 〓 +FEB4F \uDBBA\uDF4F \xF3\xBE\xAD\x8F SOS SIGN 270 F6C1 E4E8 7643 EBC1 [SOS] [SOS] +FEB50 \uDBBA\uDF50 \xF3\xBE\xAD\x90 ACCEPT SIGN 506 F7D8 EB01 785A ECD8 [可] [可] +FEB51 \uDBBA\uDF51 \xF3\xBE\xAD\x91 HEAVY PLUS 26 F758 E53C 7739 EC58 [+] [+] +FEB52 \uDBBA\uDF52 \xF3\xBE\xAD\x92 HEAVY MINUS 27 F759 E53D 773A EC59 [-] [-] +FEB53 \uDBBA\uDF53 \xF3\xBE\xAD\x93 HEAVY TIMES 55 F76B E54F 774C EC6B [×] 321 F9D3 E333 774D +FEB54 \uDBBA\uDF54 \xF3\xBE\xAD\x94 HEAVY DIVISION 66 F770 E554 7751 EC70 [÷] [÷] +FEB55 \uDBBA\uDF55 \xF3\xBE\xAD\x95 DIAMOND SHAPE WITH A DOT INSIDE 〓 148 F99D E6F8 7E29 〓 +FEB56 \uDBBA\uDF56 \xF3\xBE\xAD\x96 ELECTRIC LIGHT BULB 77 F64E E476 752F EB4E 151 F9A0 E6FB 752F 105 F74F E10F 752F +FEB57 \uDBBA\uDF57 \xF3\xBE\xAD\x97 ANGER SIGN 262 F6BE E4E5 7640 EBBE 152 F9A1 E6FC 7640 322 F9D4 E334 7640 +FEB58 \uDBBA\uDF58 \xF3\xBE\xAD\x98 BOMB 268 F652 E47A 7533 EB52 154 F9A3 E6FE 7533 287 F9B1 E311 7533 +FEB59 \uDBBA\uDF59 \xF3\xBE\xAD\x99 SLEEPING SIGN 261 F64D E475 752E EB4D 157 F9A6 E701 752E 150 F77C E13C 752E +FEB5A \uDBBA\uDF5A \xF3\xBE\xAD\x9A COLLISION SYMBOL 329 F7CD E5B0 784F ECCD 161 F9AA E705 784F [ドンッ] +FEB5B \uDBBA\uDF5B \xF3\xBE\xAD\x9B SPLASHING SWEAT 330 F7CE E5B1 7850 ECCE 162 F9AB E706 7850 319 F9D1 E331 7850 +FEB5C \uDBBA\uDF5C \xF3\xBE\xAD\x9C DRIP 263 F6BF E4E6 7641 EBBF 163 F9AC E707 7641 319 F9D1 E331 7850 +FEB5D \uDBBA\uDF5D \xF3\xBE\xAD\x9D DASH SYMBOL 282 F6CD E4F4 764F EBCD 164 F9AD E708 764F 318 F9D0 E330 764F +FEB5E \uDBBA\uDF5E \xF3\xBE\xAD\x9E FLEXED BICEP 271 F6C2 E4E9 7644 EBC2 [力こぶ] 166 F78D E14C 7644 +FEB5F \uDBBA\uDF5F \xF3\xBE\xAD\x9F DIZZY SYMBOL 778 F460 EB5C 7B41 EE60 [クラクラ] 354 FB47 E407 7D4F +FEB60 \uDBBA\uDF60 \xF3\xBE\xAD\xA0 SPARKLES 420 F37E EAAB 795F ED7E 150 F99F E6FA 795F 316 F9CE E32E 795F +FEB61 \uDBBA\uDF61 \xF3\xBE\xAD\xA1 EIGHT POINTED BLACK STAR 267 F651 E479 7532 EB51 148 F99D E6F8 7E29 185 F7A5 E205 7532 +FEB62 \uDBBA\uDF62 \xF3\xBE\xAD\xA2 EIGHT SPOKED ASTERISK 28 F75A E53E 773B EC5A 148 F99D E6F8 7E29 186 F7A6 E206 773B +FEB63 \uDBBA\uDF63 \xF3\xBE\xAD\xA3 BLACK CIRCLE 40 F766 E54A 7747 EC66 95 F940 E69C 7847 205 F7B9 E219 7747 +FEB64 \uDBBA\uDF64 \xF3\xBE\xAD\xA4 BLACK CIRCLE 2 41 F767 E54B 7748 EC67 95 F940 E69C 7847 206 F7BA E21A 7748 +FEB65 \uDBBA\uDF65 \xF3\xBE\xAD\xA5 MEDIUM BLACK CIRCLE 23 F756 E53A 7737 EC56 95 F940 E69C 7847 205 F7B9 E219 7747 +FEB66 \uDBBA\uDF66 \xF3\xBE\xAD\xA6 MEDIUM BLACK CIRCLE 2 24 F757 E53B 7738 EC57 95 F940 E69C 7847 205 F7B9 E219 7747 +FEB67 \uDBBA\uDF67 \xF3\xBE\xAD\xA7 OCTAGON 41 F767 E54B 7748 EC67 95 F940 E69C 7847 207 F7BB E21B 7D25 +FEB68 \uDBBA\uDF68 \xF3\xBE\xAD\xA8 BLACK STAR 69 F663 E48B 7544 EB63 [☆] 317 F9CF E32F 7544 +FEB69 \uDBBA\uDF69 \xF3\xBE\xAD\xA9 BLACK STAR 2 69 F663 E48B 7544 EB63 [☆] 323 F9D5 E335 7D34 +FEB6A \uDBBA\uDF6A \xF3\xBE\xAD\xAA BLACK STAR 3 75 F640 E468 7521 EB40 ☆彡 ☆彡 +FEB6B \uDBBA\uDF6B \xF3\xBE\xAD\xAB BLACK SQUARE 38 F764 E548 7745 EC64 ■ 207 F7BB E21B 7D25 +FEB6C \uDBBA\uDF6C \xF3\xBE\xAD\xAC BLACK SQUARE 2 39 F765 E549 7746 EC65 ■ 206 F7BA E21A 7748 +FEB6D \uDBBA\uDF6D \xF3\xBE\xAD\xAD BLACK SMALL SQUARE 9 F74D E531 772E EC4D ■ 207 F7BB E21B 7D25 +FEB6E \uDBBA\uDF6E \xF3\xBE\xAD\xAE BLACK SMALL SQUARE 2 10 F74E E532 772F EC4E ■ 206 F7BA E21A 7748 +FEB6F \uDBBA\uDF6F \xF3\xBE\xAD\xAF BLACK MEDIUM SMALL SQUARE 17 F750 E534 7731 EC50 ■ 207 F7BB E21B 7D25 +FEB70 \uDBBA\uDF70 \xF3\xBE\xAD\xB0 BLACK MEDIUM SMALL SQUARE 2 18 F751 E535 7732 EC51 ■ 206 F7BA E21A 7748 +FEB71 \uDBBA\uDF71 \xF3\xBE\xAD\xB1 BLACK MEDIUM SQUARE 21 F754 E538 7735 EC54 ■ 207 F7BB E21B 7D25 +FEB72 \uDBBA\uDF72 \xF3\xBE\xAD\xB2 BLACK MEDIUM SQUARE 2 22 F755 E539 7736 EC55 ■ 206 F7BA E21A 7748 +FEB73 \uDBBA\uDF73 \xF3\xBE\xAD\xB3 BLACK DIAMOND 36 F762 E546 7743 EC62 ◆ 207 F7BB E21B 7D25 +FEB74 \uDBBA\uDF74 \xF3\xBE\xAD\xB4 BLACK DIAMOND 2 37 F763 E547 7744 EC63 ◆ 207 F7BB E21B 7D25 +FEB75 \uDBBA\uDF75 \xF3\xBE\xAD\xB5 BLACK SMALL DIAMOND 19 F752 E536 7733 EC52 ◆ 207 F7BB E21B 7D25 +FEB76 \uDBBA\uDF76 \xF3\xBE\xAD\xB6 BLACK SMALL DIAMOND 2 20 F753 E537 7734 EC53 ◆ 207 F7BB E21B 7D25 +FEB77 \uDBBA\uDF77 \xF3\xBE\xAD\xB7 SPARKLE 76 F644 E46C 7525 EB44 150 F99F E6FA 795F 316 F9CE E32E 795F +FEB78 \uDBBA\uDF78 \xF3\xBE\xAD\xB8 BLACK UP-POINTING TRIANGLE 88 F776 E55A 7757 EC76 ▲ ▲ +FEB79 \uDBBA\uDF79 \xF3\xBE\xAD\xB9 BLACK DOWN-POINTING TRIANGLE 89 F777 E55B 7758 EC77 ▼ ▼ +FEB7A \uDBBA\uDF7A \xF3\xBE\xAD\xBA WHITE FLOWER 278 F6C9 E4F0 764B EBC9 [花丸] [花丸] +FEB7B \uDBBA\uDF7B \xF3\xBE\xAD\xBB HUNDRED POINTS SYMBOL 280 F6CB E4F2 764D EBCB [100点] [100点] +FEB7C \uDBBA\uDF7C \xF3\xBE\xAD\xBC LATIN CAPITAL LETTERS SYMBOL 502 F7D4 EAFD 7856 ECD4 [ABCD] [ABCD] +FEB7D \uDBBA\uDF7D \xF3\xBE\xAD\xBD LATIN SMALL LETTERS SYMBOL 503 F7D5 EAFE 7857 ECD5 [abcd] [abcd] +FEB7E \uDBBA\uDF7E \xF3\xBE\xAD\xBE NUMBERS SYMBOL 504 F7D6 EAFF 7858 ECD6 [1234] [1234] +FEB7F \uDBBA\uDF7F \xF3\xBE\xAD\xBF SYMBOLS SIGN 505 F7D7 EB00 7859 ECD7 [記号] [記号] +FEB80 \uDBBA\uDF80 \xF3\xBE\xAE\x80 ENGLISH LANGUAGE SYMBOL 771 F459 EB55 7B3A EE59 [ABC] [ABC] +FEB81 \uDBBA\uDF81 \xF3\xBE\xAE\x81 ID 385 F35B EA88 793C ED5B 115 F97C E6D8 793C 221 F7C9 E229 793C +FEB82 \uDBBA\uDF82 \xF3\xBE\xAE\x82 KEY 120 F6F2 E519 7674 EBF2 116 F97D E6D9 7674 63 F980 E03F 7674 +FEB83 \uDBBA\uDF83 \xF3\xBE\xAE\x83 LEFTWARDS ARROW WITH HOOK 118 F779 E55D 775A EC79 117 F97E E6DA 775A ←┘ +FEB84 \uDBBA\uDF84 \xF3\xBE\xAE\x84 CLEAR SIGN 324 F7C8 E5AB 784A ECC8 118 F980 E6DB 784A [CL] +FEB85 \uDBBA\uDF85 \xF3\xBE\xAE\x85 MAGNIFYING GLASS 119 F6F1 E518 7673 EBF1 119 F981 E6DC 7673 110 F754 E114 7673 +FEB86 \uDBBA\uDF86 \xF3\xBE\xAE\x86 LOCK 138 F6F5 E51C 7677 EBF5 116 F97D E6D9 7674 158 F785 E144 7677 +FEB87 \uDBBA\uDF87 \xF3\xBE\xAE\x87 LOCK 2 138 F6F5 E51C 7677 EBF5 116 F97D E6D9 7674 159 F786 E145 7D3E +FEB88 \uDBBA\uDF88 \xF3\xBE\xAE\x88 RIGHTWARDS ARROW WITH HOOK 117 F778 E55C 7759 EC78 └→ └→ +FEB89 \uDBBA\uDF89 \xF3\xBE\xAE\x89 OPENWAVE 500 F7D2 EAFB 7854 ECD2 [オープンウェブ] [オープンウェブ] +FEB8A \uDBBA\uDF8A \xF3\xBE\xAE\x8A CLOSED LOCK WITH KEY 501 F7D3 EAFC 7855 ECD3 116 F97D E6D9 7674 158 F785 E144 7677 +FEB8B \uDBBA\uDF8B \xF3\xBE\xAE\x8B BALLOT BOX WITH CHECK 507 F7D9 EB02 785B ECD9 [チェックマーク] [チェックマーク] +FEB8C \uDBBA\uDF8C \xF3\xBE\xAE\x8C RADIO BUTTON 509 F7DB EB04 785D ECDB [ラジオボタン] [ラジオボタン] +FEB8D \uDBBA\uDF8D \xF3\xBE\xAE\x8D MAGNIFYING GLASS 2 510 F7DC EB05 785E ECDC 119 F981 E6DC 7673 110 F754 E114 7673 +FEB8E \uDBBA\uDF8E \xF3\xBE\xAE\x8E LEFTWARDS ARROW WITH LETTER BACK 511 F7DD EB06 785F ECDD [←BACK] 233 F7D5 E235 7750 +FEB8F \uDBBA\uDF8F \xF3\xBE\xAE\x8F BOOKMARK 512 F7DE EB07 7860 ECDE [ブックマーク] [ブックマーク] +FEB90 \uDBBA\uDF90 \xF3\xBE\xAE\x90 LOCK WITH INK PEN 517 F7E3 EB0C 7865 ECE3 116 F97D E6D9 7674 158 F785 E144 7677 +FEB91 \uDBBA\uDF91 \xF3\xBE\xAE\x91 DOUBLE CLOCKWISE OPEN CIRCLE ARROWS 518 F7E4 EB0D 7866 ECE4 342 F9DA E735 7B5E ↑↓ +FEB92 \uDBBA\uDF92 \xF3\xBE\xAE\x92 EMAIL SIGN 799 F475 EB71 7B56 EE75 110 F977 E6D3 767C 93 F743 E103 7B47 +FEB93 \uDBBA\uDF93 \xF3\xBE\xAE\x93 ROCK IN HAND GAME 817 F488 EB83 7B68 EE88 86 F8F4 E693 7B68 16 F950 E010 7B68 +FEB94 \uDBBA\uDF94 \xF3\xBE\xAE\x94 SCISSOR IN HAND GAME 319 F7C3 E5A6 7845 ECC3 87 F8F5 E694 7845 17 F951 E011 7845 +FEB95 \uDBBA\uDF95 \xF3\xBE\xAE\x95 PAPER IN HAND GAME 320 F7C4 E5A7 7846 ECC4 88 F8F6 E695 7846 18 F952 E012 7846 +FEB96 \uDBBA\uDF96 \xF3\xBE\xAE\x96 FISTED HAND 281 F6CC E4F3 764E EBCC 153 F9A2 E6FD 764E 13 F94D E00D 764E +FEB97 \uDBBA\uDF97 \xF3\xBE\xAE\x97 THUMBS UP SIGN 287 F6D2 E4F9 7654 EBD2 328 F9CC E727 7654 14 F94E E00E 7654 +FEB98 \uDBBA\uDF98 \xF3\xBE\xAE\x98 INDEX FINGER POINTING UPWARDS 284 F6CF E4F6 7651 EBCF [人差し指] 15 F94F E00F 7651 +FEB99 \uDBBA\uDF99 \xF3\xBE\xAE\x99 WHITE UP POINTING INDEX 390 F360 EA8D 7941 ED60 [↑] 226 F7CE E22E 7941 +FEB9A \uDBBA\uDF9A \xF3\xBE\xAE\x9A WHITE DOWN POINTING INDEX 391 F361 EA8E 7942 ED61 [↓] 227 F7CF E22F 7942 +FEB9B \uDBBA\uDF9B \xF3\xBE\xAE\x9B WHITE LEFT POINTING INDEX 140 F6D8 E4FF 765A EBD8 [←] 228 F7D0 E230 765A +FEB9C \uDBBA\uDF9C \xF3\xBE\xAE\x9C WHITE RIGHT POINTING INDEX 141 F6D9 E500 765B EBD9 [→] 229 F7D1 E231 765B +FEB9D \uDBBA\uDF9D \xF3\xBE\xAE\x9D WAVING HAND 463 F3AA EAD6 7A2C EDAA 88 F8F6 E695 7846 377 FB5E E41E 7A2C +FEB9E \uDBBA\uDF9E \xF3\xBE\xAE\x9E CLAPPING HANDS 460 F3A7 EAD3 7A29 EDA7 [拍手] 378 FB5F E41F 7A29 +FEB9F \uDBBA\uDF9F \xF3\xBE\xAE\x9F OK HAND SIGN 461 F3A8 EAD4 7A2A EDA8 135 F9B0 E70B 784C 379 FB60 E420 7A2A +FEBA0 \uDBBA\uDFA0 \xF3\xBE\xAE\xA0 THUMBS DOWN SIGN 462 F3A9 EAD5 7A2B EDA9 156 F9A5 E700 7A71 380 FB61 E421 7A2B +FEBA1 \uDBBA\uDFA1 \xF3\xBE\xAE\xA1 OPEN HANDS 463 F3AA EAD6 7A2C EDAA 88 F8F6 E695 7846 381 FB62 E422 7D52 +FEBA2 \uDBBA\uDFA2 \xF3\xBE\xAE\xA2 ROCK ON [ロックオン] [ロックオン] [ロックオン] +FEE10 \uDBBB\uDE10 \xF3\xBE\xB8\x90 I-MODE [iモード] 108 F975 E6D1 7E25 [iモード] +FEE11 \uDBBB\uDE11 \xF3\xBE\xB8\x91 I-MODE WITH FRAME [iモード] 109 F976 E6D2 7E26 [iモード] +FEE12 \uDBBB\uDE12 \xF3\xBE\xB8\x92 PROVIDED BY DOCOMO [ドコモ] 111 F978 E6D4 7E27 [ドコモ] +FEE13 \uDBBB\uDE13 \xF3\xBE\xB8\x93 DOCOMO POINT [ドコモポイント] 112 F979 E6D5 7E28 [ドコモポイント] +FEE14 \uDBBB\uDE14 \xF3\xBE\xB8\x94 I-APPLI [iアプリ] 301 F9B1 E70C 7E30 [iアプリ] +FEE15 \uDBBB\uDE15 \xF3\xBE\xB8\x95 I-APPLI WITH BORDER [iアプリ] 302 F9B2 E70D 7E31 [iアプリ] +FEE16 \uDBBB\uDE16 \xF3\xBE\xB8\x96 PIAS PI [ぴ] 177 F94A E6A6 222E [ぴ] +FEE17 \uDBBB\uDE17 \xF3\xBE\xB8\x97 PIAS A [あ] 178 F94B E6A7 222E [あ] +FEE18 \uDBBB\uDE18 \xF3\xBE\xB8\x98 INVERSE TICKET [チケット] 179 F94C E6A8 222E [チケット] +FEE19 \uDBBB\uDE19 \xF3\xBE\xB8\x99 KATAKANA ABBREVIATION FOR TICKET [チケット] 180 F94D E6A9 222E [チケット] +FEE1A \uDBBB\uDE1A \xF3\xBE\xB8\x9A RESERVE BY PHONE [電話先行] 181 F94E E6AA 222E [電話先行] +FEE1B \uDBBB\uDE1B \xF3\xBE\xB8\x9B P CODE [Pコード] 182 F94F E6AB 222E [Pコード] +FEE1C \uDBBB\uDE1C \xF3\xBE\xB8\x9C MOVIES 2 110 F6F0 E517 7672 EBF0 183 F953 E6AF 222E 61 F97D E03D 7672 +FEE1D \uDBBB\uDE1D \xF3\xBE\xB8\x9D PIAS PI INVERSE [ぴ] 184 F954 E6B0 222E [ぴ] +FEE1E \uDBBB\uDE1E \xF3\xBE\xB8\x9E PIAS PI CIRCLE (ぴ) 185 F958 E6B4 222E (ぴ) +FEE1F \uDBBB\uDE1F \xF3\xBE\xB8\x9F PIAS PI SQUARE [ぴ] 186 F959 E6B5 222E [ぴ] +FEE20 \uDBBB\uDE20 \xF3\xBE\xB8\xA0 CHECK [チェック] 187 F95A E6B6 222E [チェック] +FEE21 \uDBBB\uDE21 \xF3\xBE\xB8\xA1 F [F] 188 F95F E6BB 222E [F] +FEE22 \uDBBB\uDE22 \xF3\xBE\xB8\xA2 D [D] 189 F960 E6BC 222E [D] +FEE23 \uDBBB\uDE23 \xF3\xBE\xB8\xA3 S [S] 190 F961 E6BD 222E [S] +FEE24 \uDBBB\uDE24 \xF3\xBE\xB8\xA4 C [C] 191 F962 E6BE 222E [C] +FEE25 \uDBBB\uDE25 \xF3\xBE\xB8\xA5 R [R] 192 F963 E6BF 222E [R] +FEE26 \uDBBB\uDE26 \xF3\xBE\xB8\xA6 BLACK AND WHITE SQUARE ■ 193 F964 E6C0 222E ■ +FEE27 \uDBBB\uDE27 \xF3\xBE\xB8\xA7 BLACK SQUARE 3 ■ 194 F965 E6C1 222E ■ +FEE28 \uDBBB\uDE28 \xF3\xBE\xB8\xA8 DOWNWARD TRIANGLE ▼ 195 F966 E6C2 222E ▼ +FEE29 \uDBBB\uDE29 \xF3\xBE\xB8\xA9 FOUR DAGGERS †††† 196 F967 E6C3 222E †††† +FEE2A \uDBBB\uDE2A \xF3\xBE\xB8\xAA THREE DAGGERS ††† 197 F968 E6C4 222E ††† +FEE2B \uDBBB\uDE2B \xF3\xBE\xB8\xAB TWO DAGGERS †† 198 F969 E6C5 222E †† +FEE2C \uDBBB\uDE2C \xF3\xBE\xB8\xAC DAGGER † 199 F96A E6C6 222E † +FEE2D \uDBBB\uDE2D \xF3\xBE\xB8\xAD I [I] 200 F96B E6C7 222E [I] +FEE2E \uDBBB\uDE2E \xF3\xBE\xB8\xAE M [M] 201 F96C E6C8 222E [M] +FEE2F \uDBBB\uDE2F \xF3\xBE\xB8\xAF E [E] 202 F96D E6C9 222E [E] +FEE30 \uDBBB\uDE30 \xF3\xBE\xB8\xB0 VE [VE] 203 F96E E6CA 222E [VE] +FEE31 \uDBBB\uDE31 \xF3\xBE\xB8\xB1 SPHERE ● 204 F96F E6CB 222E ● +FEE32 \uDBBB\uDE32 \xF3\xBE\xB8\xB2 CREDIT CARDS NOT ACCEPTED [カード使用不可] 205 F970 E6CC 222E [カード使用不可] +FEE33 \uDBBB\uDE33 \xF3\xBE\xB8\xB3 CHECKBOX 507 F7D9 EB02 785B ECD9 206 F971 E6CD 222E [チェックボックス] +FEE40 \uDBBB\uDE40 \xF3\xBE\xB9\x80 EZ WEB 298 F794 E577 7774 EC94 [EZ] [EZ] +FEE41 \uDBBB\uDE41 \xF3\xBE\xB9\x81 EZ PLUS 331 F7CF E5B2 7851 ECCF [ezplus] [ezplus] +FEE42 \uDBBB\uDE42 \xF3\xBE\xB9\x82 EZ NAVIGATION 406 F370 EA9D 7951 ED70 [EZナビ] [EZナビ] +FEE43 \uDBBB\uDE43 \xF3\xBE\xB9\x83 EZ MOVIE 802 F478 EB74 7B59 EE78 [EZムービー] [EZムービー] +FEE44 \uDBBB\uDE44 \xF3\xBE\xB9\x84 CMAIL 815 F486 EB81 7B66 EE86 [Cメール] [Cメール] +FEE45 \uDBBB\uDE45 \xF3\xBE\xB9\x85 JAVA 823 F48E EB89 7B6E EE8E [Java] [Java] +FEE46 \uDBBB\uDE46 \xF3\xBE\xB9\x86 BREW 824 F48F EB8A 7B6F EE8F [BREW] [BREW] +FEE47 \uDBBB\uDE47 \xF3\xBE\xB9\x87 EZ RING MUSIC 825 F490 EB8B 7B70 EE90 [EZ着うた] [EZ着うた] +FEE48 \uDBBB\uDE48 \xF3\xBE\xB9\x88 EZ NAVI 826 F491 EB8C 7B71 EE91 [EZナビ] [EZナビ] +FEE49 \uDBBB\uDE49 \xF3\xBE\xB9\x89 WIN 827 F492 EB8D 7B72 EE92 [WIN] [WIN] +FEE4A \uDBBB\uDE4A \xF3\xBE\xB9\x8A PREMIUM SIGN 828 F493 EB8E 7B73 EE93 [プレミアム] [プレミアム] +FEE70 \uDBBB\uDE70 \xF3\xBE\xB9\xB0 J-SKY1 〓 〓 479 FBD8 E538 222E +FEE71 \uDBBB\uDE71 \xF3\xBE\xB9\xB1 J-SKY2 〓 〓 480 FBD9 E539 222E +FEE72 \uDBBB\uDE72 \xF3\xBE\xB9\xB2 VODAFONE1 〓 〓 481 FBDA E53A 7D73 +FEE73 \uDBBB\uDE73 \xF3\xBE\xB9\xB3 VODAFONE2 〓 〓 482 FBDB E53B 7D74 +FEE74 \uDBBB\uDE74 \xF3\xBE\xB9\xB4 VODAFONE3 [v [v 483 FBDC E53C 7D75 +FEE75 \uDBBB\uDE75 \xF3\xBE\xB9\xB5 VODAFONE4 oda oda 484 FBDD E53D 7D76 +FEE76 \uDBBB\uDE76 \xF3\xBE\xB9\xB6 VODAFONE5 fone] fone] 485 FBDE E53E 7D77 +FEE77 \uDBBB\uDE77 \xF3\xBE\xB9\xB7 J-PHONE SHOP 〓 〓 264 F7F4 E254 222E +FEE78 \uDBBB\uDE78 \xF3\xBE\xB9\xB8 SKY WEB 〓 〓 265 F7F5 E255 222E +FEE79 \uDBBB\uDE79 \xF3\xBE\xB9\xB9 SKY WALKER 〓 〓 266 F7F6 E256 222E +FEE7A \uDBBB\uDE7A \xF3\xBE\xB9\xBA SKY MELODY 〓 〓 267 F7F7 E257 222E +FEE7B \uDBBB\uDE7B \xF3\xBE\xB9\xBB J-PHONE 1 〓 〓 268 F7F8 E258 222E +FEE7C \uDBBB\uDE7C \xF3\xBE\xB9\xBC J-PHONE 2 〓 〓 269 F7F9 E259 222E +FEE7D \uDBBB\uDE7D \xF3\xBE\xB9\xBD J-PHONE 3 〓 〓 270 F7FA E25A 222E +FEEA0 \uDBBB\uDEA0 \xF3\xBE\xBA\xA0 GOOGLE [Google] [Google] [Google] diff --git a/include/core/SkFontHost.h b/include/core/SkFontHost.h index d98c55f..942350f 100644 --- a/include/core/SkFontHost.h +++ b/include/core/SkFontHost.h @@ -117,11 +117,14 @@ public: */ static SkScalerContext* CreateScalerContext(const SkDescriptor* desc); - /** Return a scalercontext using the "fallback" font. If there is no - designated fallback, return null. + /** Given a "current" fontID, return the next logical fontID to use + when searching fonts for a given unicode value. Typically the caller + will query a given font, and if a unicode value is not supported, they + will call this, and if 0 is not returned, will search that font, and so + on. This process must be finite, and when the fonthost sees a + font with no logical successor, it must return 0. */ - static SkScalerContext* CreateFallbackScalerContext( - const SkScalerContext::Rec&); + static uint32_t NextLogicalFont(uint32_t fontID); /////////////////////////////////////////////////////////////////////////// diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h index 583833e..b06a443 100644 --- a/include/core/SkScalerContext.h +++ b/include/core/SkScalerContext.h @@ -169,10 +169,16 @@ public: SkScalerContext(const SkDescriptor* desc); virtual ~SkScalerContext(); + // remember our glyph offset/base void setBaseGlyphCount(unsigned baseGlyphCount) { fBaseGlyphCount = baseGlyphCount; } + /** Return the corresponding glyph for the specified unichar. Since contexts + may be chained (under the hood), the glyphID that is returned may in + fact correspond to a different font/context. In that case, we use the + base-glyph-count to know how to translate back into local glyph space. + */ uint16_t charToGlyphID(SkUnichar uni); unsigned getGlyphCount() const { return this->generateGlyphCount(); } @@ -208,12 +214,15 @@ private: void internalGetPath(const SkGlyph& glyph, SkPath* fillPath, SkPath* devPath, SkMatrix* fillToDevMatrix); - mutable SkScalerContext* fAuxScalerContext; + // return the next context, treating fNextContext as a cache of the answer + SkScalerContext* getNextContext(); - SkScalerContext* getGlyphContext(const SkGlyph& glyph) const; - - // return loaded fAuxScalerContext or NULL - SkScalerContext* loadAuxContext() const; + // returns the right context from our link-list for this glyph. If no match + // is found, just returns the original context (this) + SkScalerContext* getGlyphContext(const SkGlyph& glyph); + + // link-list of context, to handle missing chars. null-terminated. + SkScalerContext* fNextContext; }; #define kRec_SkDescriptorTag SkSetFourByteTag('s', 'r', 'e', 'c') diff --git a/include/images/SkImageDecoder.h b/include/images/SkImageDecoder.h index 3ea6198..c85a7cd 100644 --- a/include/images/SkImageDecoder.h +++ b/include/images/SkImageDecoder.h @@ -147,7 +147,7 @@ public: If none is found, the method returns NULL. */ static SkImageDecoder* Factory(SkStream*); - + /** Decode the image stored in the specified file, and store the result in bitmap. Return true for success or false on failure. @@ -260,4 +260,24 @@ private: SkImageDecoder& operator=(const SkImageDecoder&); }; +/** Calling newDecoder with a stream returns a new matching imagedecoder + instance, or NULL if none can be found. The caller must manage its ownership + of the stream as usual, calling unref() when it is done, as the returned + decoder may have called ref() (and if so, the decoder is responsible for + balancing its ownership when it is destroyed). + */ +class SkImageDecoderFactory : public SkRefCnt { +public: + virtual SkImageDecoder* newDecoder(SkStream*) = 0; +}; + +class SkDefaultImageDecoderFactory : SkImageDecoderFactory { +public: + // calls SkImageDecoder::Factory(stream) + virtual SkImageDecoder* newDecoder(SkStream* stream) { + return SkImageDecoder::Factory(stream); + } +}; + + #endif diff --git a/include/images/SkImageRef.h b/include/images/SkImageRef.h index e94b7d4..6ab6e52 100644 --- a/include/images/SkImageRef.h +++ b/include/images/SkImageRef.h @@ -35,9 +35,9 @@ public: that this imageref is the only owner of the stream. i.e. - sole ownership of the stream object is transferred to this imageref object. - @param stream The stream containing the encoded image data. Ownership - of this stream is transferred to the imageref, and - therefore the stream's ownercount must be 1. + @param stream The stream containing the encoded image data. This may be + retained (by calling ref()), so the caller should not + explicitly delete it. @param config The preferred config of the decoded bitmap. @param sampleSize Requested sampleSize for decoding. Defaults to 1. */ @@ -52,6 +52,10 @@ public: and ignore the bitmap parameter. */ bool getInfo(SkBitmap* bm); + + SkImageDecoderFactory* getDecoderFactory() const { return fFactory; } + // returns the factory parameter + SkImageDecoderFactory* setDecoderFactory(SkImageDecoderFactory*); // overrides virtual void flatten(SkFlattenableWriteBuffer&) const; @@ -81,10 +85,11 @@ private: // requested state (or further, i.e. has pixels) bool prepareBitmap(SkImageDecoder::Mode); - SkStream* fStream; - SkBitmap::Config fConfig; - int fSampleSize; - bool fErrorInDecoding; + SkImageDecoderFactory* fFactory; // may be null + SkStream* fStream; + SkBitmap::Config fConfig; + int fSampleSize; + bool fErrorInDecoding; friend class SkImageRefPool; diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp deleted file mode 100644 index 968263b..0000000 --- a/samplecode/SampleAll.cpp +++ /dev/null @@ -1,791 +0,0 @@ -#include "SampleCode.h" -#include "SkCanvas.h" -#include "SkView.h" -#include "Sk1DPathEffect.h" -#include "Sk2DPathEffect.h" -#include "SkAvoidXfermode.h" -#include "SkBlurMaskFilter.h" -#include "SkColorFilter.h" -#include "SkColorPriv.h" -#include "SkCornerPathEffect.h" -#include "SkDashPathEffect.h" -#include "SkDiscretePathEffect.h" -#include "SkEmbossMaskFilter.h" -#include "SkGradientShader.h" -#include "SkImageDecoder.h" -#include "SkLayerRasterizer.h" -#include "SkMath.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkShaderExtras.h" -#include "SkCornerPathEffect.h" -#include "SkPathMeasure.h" -#include "SkPicture.h" -#include "SkRandom.h" -#include "SkTransparentShader.h" -#include "SkTypeface.h" -#include "SkUnitMappers.h" -#include "SkUtils.h" -#include "SkXfermode.h" - -#include <math.h> - -extern void Dump(); - -static inline SkPMColor rgb2gray(SkPMColor c) -{ - unsigned r = SkGetPackedR32(c); - unsigned g = SkGetPackedG32(c); - unsigned b = SkGetPackedB32(c); - - unsigned x = r * 5 + g * 7 + b * 4 >> 4; - - return SkPackARGB32(0, x, x, x) | (c & (SK_A32_MASK << SK_A32_SHIFT)); -} - -class SkGrayScaleColorFilter : public SkColorFilter { -public: - virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[]) - { - for (int i = 0; i < count; i++) - result[i] = rgb2gray(src[i]); - } -}; - -class SkChannelMaskColorFilter : public SkColorFilter { -public: - SkChannelMaskColorFilter(U8CPU redMask, U8CPU greenMask, U8CPU blueMask) - { - fMask = SkPackARGB32(0xFF, redMask, greenMask, blueMask); - } - - virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[]) - { - SkPMColor mask = fMask; - for (int i = 0; i < count; i++) - result[i] = src[i] & mask; - } - -private: - SkPMColor fMask; -}; - -/////////////////////////////////////////////////////////// - -static void r0(SkLayerRasterizer* rast, SkPaint& p) -{ - p.setMaskFilter(SkBlurMaskFilter::Create(SkIntToScalar(3), - SkBlurMaskFilter::kNormal_BlurStyle))->unref(); - rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); - - p.setMaskFilter(NULL); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1); - rast->addLayer(p); - - p.setAlpha(0x11); - p.setStyle(SkPaint::kFill_Style); - p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode); - rast->addLayer(p); -} - -static void r1(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - p.setAlpha(0x40); - p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1*2); - rast->addLayer(p); -} - -static void r2(SkLayerRasterizer* rast, SkPaint& p) -{ - p.setStyle(SkPaint::kStrokeAndFill_Style); - p.setStrokeWidth(SK_Scalar1*4); - rast->addLayer(p); - - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1*3/2); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p); -} - -static void r3(SkLayerRasterizer* rast, SkPaint& p) -{ - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1*3); - rast->addLayer(p); - - p.setAlpha(0x20); - p.setStyle(SkPaint::kFill_Style); - p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode); - rast->addLayer(p); -} - -static void r4(SkLayerRasterizer* rast, SkPaint& p) -{ - p.setAlpha(0x60); - rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); - - p.setAlpha(0xFF); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p, SK_Scalar1*3/2, SK_Scalar1*3/2); - - p.setXfermode(NULL); - rast->addLayer(p); -} - -static void r5(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - p.setPathEffect(new SkDiscretePathEffect(SK_Scalar1*4, SK_Scalar1*3))->unref(); - p.setPorterDuffXfermode(SkPorterDuff::kSrcOut_Mode); - rast->addLayer(p); -} - -static void r6(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - p.setAntiAlias(false); - SkLayerRasterizer* rast2 = new SkLayerRasterizer; - r5(rast2, p); - p.setRasterizer(rast2)->unref(); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p); -} - -class Dot2DPathEffect : public Sk2DPathEffect { -public: - Dot2DPathEffect(SkScalar radius, const SkMatrix& matrix) - : Sk2DPathEffect(matrix), fRadius(radius) {} - - virtual void flatten(SkFlattenableWriteBuffer& buffer) - { - this->INHERITED::flatten(buffer); - - buffer.writeScalar(fRadius); - } - virtual Factory getFactory() { return CreateProc; } - -protected: - virtual void next(const SkPoint& loc, int u, int v, SkPath* dst) - { - dst->addCircle(loc.fX, loc.fY, fRadius); - } - - Dot2DPathEffect(SkFlattenableReadBuffer& buffer) : Sk2DPathEffect(buffer) - { - fRadius = buffer.readScalar(); - } -private: - SkScalar fRadius; - - static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) - { - return new Dot2DPathEffect(buffer); - } - - typedef Sk2DPathEffect INHERITED; -}; - -static void r7(SkLayerRasterizer* rast, SkPaint& p) -{ - SkMatrix lattice; - lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0); - lattice.postSkew(SK_Scalar1/3, 0, 0, 0); - p.setPathEffect(new Dot2DPathEffect(SK_Scalar1*4, lattice))->unref(); - rast->addLayer(p); -} - -static void r8(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - SkMatrix lattice; - lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0); - lattice.postSkew(SK_Scalar1/3, 0, 0, 0); - p.setPathEffect(new Dot2DPathEffect(SK_Scalar1*2, lattice))->unref(); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p); - - p.setPathEffect(NULL); - p.setXfermode(NULL); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1); - rast->addLayer(p); -} - -class Line2DPathEffect : public Sk2DPathEffect { -public: - Line2DPathEffect(SkScalar width, const SkMatrix& matrix) - : Sk2DPathEffect(matrix), fWidth(width) {} - - virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width) - { - if (this->INHERITED::filterPath(dst, src, width)) - { - *width = fWidth; - return true; - } - return false; - } - - virtual Factory getFactory() { return CreateProc; } - virtual void flatten(SkFlattenableWriteBuffer& buffer) - { - this->INHERITED::flatten(buffer); - buffer.writeScalar(fWidth); - } -protected: - virtual void nextSpan(int u, int v, int ucount, SkPath* dst) - { - if (ucount > 1) - { - SkPoint src[2], dstP[2]; - - src[0].set(SkIntToScalar(u) + SK_ScalarHalf, - SkIntToScalar(v) + SK_ScalarHalf); - src[1].set(SkIntToScalar(u+ucount) + SK_ScalarHalf, - SkIntToScalar(v) + SK_ScalarHalf); - this->getMatrix().mapPoints(dstP, src, 2); - - dst->moveTo(dstP[0]); - dst->lineTo(dstP[1]); - } - } - - Line2DPathEffect::Line2DPathEffect(SkFlattenableReadBuffer& buffer) : Sk2DPathEffect(buffer) - { - fWidth = buffer.readScalar(); - } - -private: - SkScalar fWidth; - - static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { return new Line2DPathEffect(buffer); } - - typedef Sk2DPathEffect INHERITED; -}; - -static void r9(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - SkMatrix lattice; - lattice.setScale(SK_Scalar1, SK_Scalar1*6, 0, 0); - lattice.postRotate(SkIntToScalar(30), 0, 0); - p.setPathEffect(new Line2DPathEffect(SK_Scalar1*2, lattice))->unref(); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p); - - p.setPathEffect(NULL); - p.setXfermode(NULL); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1); - rast->addLayer(p); -} - -typedef void (*raster_proc)(SkLayerRasterizer*, SkPaint&); - -static const raster_proc gRastProcs[] = { - r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 -}; - -static const struct { - SkColor fMul, fAdd; -} gLightingColors[] = { - { 0x808080, 0x800000 }, // general case - { 0x707070, 0x707070 }, // no-pin case - { 0xFFFFFF, 0x800000 }, // just-add case - { 0x808080, 0x000000 }, // just-mul case - { 0xFFFFFF, 0x000000 } // identity case -}; - -static unsigned color_dist16(uint16_t a, uint16_t b) -{ - unsigned dr = SkAbs32(SkPacked16ToR32(a) - SkPacked16ToR32(b)); - unsigned dg = SkAbs32(SkPacked16ToG32(a) - SkPacked16ToG32(b)); - unsigned db = SkAbs32(SkPacked16ToB32(a) - SkPacked16ToB32(b)); - - return SkMax32(dr, SkMax32(dg, db)); -} - -static unsigned scale_dist(unsigned dist, unsigned scale) -{ - dist >>= 6; - dist = (dist << 2) | dist; - dist = (dist << 4) | dist; - return dist; - -// return SkAlphaMul(dist, scale); -} - -static void apply_shader(SkPaint* paint, int index) -{ - raster_proc proc = gRastProcs[index]; - if (proc) - { - SkPaint p; - SkLayerRasterizer* rast = new SkLayerRasterizer; - - p.setAntiAlias(true); - proc(rast, p); - paint->setRasterizer(rast)->unref(); - } - -#if 1 - SkScalar dir[] = { SK_Scalar1, SK_Scalar1, SK_Scalar1 }; - paint->setMaskFilter(SkBlurMaskFilter::CreateEmboss(dir, SK_Scalar1/4, SkIntToScalar(4), SkIntToScalar(3)))->unref(); - paint->setColor(SK_ColorBLUE); -#endif -} - -static void test_math() -{ - float x; - const float PI = 3.141593; - - for (x = 0; x < 1; x += 0.05f) - printf("atan(%g) = %g\n", x, atanf(x) * 180/PI); - for (x = 1; x < 10000000; x *= 2) - printf("atan(%g) = %g\n", x, atanf(x) * 180/PI); -} - -class DemoView : public SkView { -public: - DemoView() - { - test_math(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Demo"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - - void makePath(SkPath& path) - { - path.addCircle(SkIntToScalar(20), SkIntToScalar(20), SkIntToScalar(20), - SkPath::kCCW_Direction); - for (int index = 0; index < 10; index++) { - SkScalar x = SkFloatToScalar(cos(index / 10.0f * 2 * 3.1415925358f)); - SkScalar y = SkFloatToScalar(sin(index / 10.0f * 2 * 3.1415925358f)); - x *= index & 1 ? 7 : 14; - y *= index & 1 ? 7 : 14; - x += SkIntToScalar(20); - y += SkIntToScalar(20); - if (index == 0) - path.moveTo(x, y); - else - path.lineTo(x, y); - } - path.close(); - } - - virtual void onDraw(SkCanvas* canvas) - { - canvas->drawColor(SK_ColorWHITE); - canvas->save(); - drawPicture(canvas, 0); - canvas->restore(); - - { - SkPicture picture; - SkCanvas* record = picture.beginRecording(320, 480); - drawPicture(record, 120); - canvas->translate(0, SkIntToScalar(120)); - - SkRect clip; - clip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160)); - do { - canvas->save(); - canvas->clipRect(clip); - picture.draw(canvas); - canvas->restore(); - if (clip.fRight < SkIntToScalar(320)) - clip.offset(SkIntToScalar(160), 0); - else if (clip.fBottom < SkIntToScalar(480)) - clip.offset(-SkIntToScalar(320), SkIntToScalar(160)); - else - break; - } while (true); - } - Dump(); - } - - void drawPicture(SkCanvas* canvas, int spriteOffset) - { - SkMatrix matrix; matrix.reset(); - SkPaint paint; - SkPath path; - SkPoint start = {0, 0}; - SkPoint stop = { SkIntToScalar(40), SkIntToScalar(40) }; - SkRect rect = {0, 0, SkIntToScalar(40), SkIntToScalar(40) }; - SkRect rect2 = {0, 0, SkIntToScalar(65), SkIntToScalar(20) }; - SkScalar left = 0, top = 0, x = 0, y = 0; - int index; - - char ascii[] = "ascii..."; - size_t asciiLength = sizeof(ascii) - 1; - char utf8[] = "utf8" "\xe2\x80\xa6"; - short utf16[] = {'u', 't', 'f', '1', '6', 0x2026 }; - short utf16simple[] = {'u', 't', 'f', '1', '6', '!' }; - - makePath(path); - SkTDArray<SkPoint>(pos); - pos.setCount(asciiLength); - for (index = 0; index < asciiLength; index++) - pos[index].set(SkIntToScalar(index * 10), SkIntToScalar(index * 2)); - SkTDArray<SkPoint>(pos2); - pos2.setCount(asciiLength); - for (index = 0; index < asciiLength; index++) - pos2[index].set(SkIntToScalar(index * 10), SkIntToScalar(20)); - - // shaders - SkPoint linearPoints[] = { 0, 0, SkIntToScalar(40), SkIntToScalar(40) }; - SkColor linearColors[] = { SK_ColorRED, SK_ColorBLUE }; - SkScalar* linearPos = NULL; - int linearCount = 2; - SkShader::TileMode linearMode = SkShader::kMirror_TileMode; - SkUnitMapper* linearMapper = new SkDiscreteMapper(3); - SkAutoUnref unmapLinearMapper(linearMapper); - SkShader* linear = SkGradientShader::CreateLinear(linearPoints, - linearColors, linearPos, linearCount, linearMode, linearMapper); - - SkPoint radialCenter = { SkIntToScalar(25), SkIntToScalar(25) }; - SkScalar radialRadius = SkIntToScalar(25); - SkColor radialColors[] = { SK_ColorGREEN, SK_ColorGRAY, SK_ColorRED }; - SkScalar radialPos[] = { 0, SkIntToScalar(3) / 5, SkIntToScalar(1)}; - int radialCount = 3; - SkShader::TileMode radialMode = SkShader::kRepeat_TileMode; - SkUnitMapper* radialMapper = new SkCosineMapper(); - SkAutoUnref unmapRadialMapper(radialMapper); - SkShader* radial = SkGradientShader::CreateRadial(radialCenter, - radialRadius, radialColors, radialPos, radialCount, - radialMode, radialMapper); - - SkTransparentShader* transparentShader = new SkTransparentShader(); - SkEmbossMaskFilter::Light light; - light.fDirection[0] = SK_Scalar1/2; - light.fDirection[1] = SK_Scalar1/2; - light.fDirection[2] = SK_Scalar1/3; - light.fAmbient = 0x48; - light.fSpecular = 0x80; - SkScalar radius = SkIntToScalar(12)/5; - SkEmbossMaskFilter* embossFilter = new SkEmbossMaskFilter(light, - radius); - - SkXfermode* xfermode = SkPorterDuff::CreateXfermode(SkPorterDuff::kXor_Mode); - SkColorFilter* lightingFilter = SkColorFilter::CreateLightingFilter( - 0xff89bc45, 0xff112233); - - canvas->save(); - canvas->translate(SkIntToScalar(0), SkIntToScalar(5)); - paint.setFlags(SkPaint::kAntiAlias_Flag | SkPaint::kFilterBitmap_Flag); - // !!! draw through a clip - paint.setColor(SK_ColorLTGRAY); - paint.setStyle(SkPaint::kFill_Style); - SkRect clip = {0, 0, SkIntToScalar(320), SkIntToScalar(120)}; - canvas->clipRect(clip); - paint.setShader(SkShader::CreateBitmapShader(fTx, - SkShader::kMirror_TileMode, SkShader::kRepeat_TileMode))->unref(); - canvas->drawPaint(paint); - canvas->save(); - - // line (exercises xfermode, colorShader, colorFilter, filterShader) - paint.setColor(SK_ColorGREEN); - paint.setStrokeWidth(SkIntToScalar(10)); - paint.setStyle(SkPaint::kStroke_Style); - paint.setXfermode(xfermode)->unref(); - paint.setColorFilter(lightingFilter)->unref(); - canvas->drawLine(start.fX, start.fY, stop.fX, stop.fY, paint); // should not be green - paint.setXfermode(NULL); - paint.setColorFilter(NULL); - - // rectangle - paint.setStyle(SkPaint::kFill_Style); - canvas->translate(SkIntToScalar(50), 0); - paint.setColor(SK_ColorYELLOW); - paint.setShader(linear)->unref(); - paint.setPathEffect(pathEffectTest())->unref(); - canvas->drawRect(rect, paint); - paint.setPathEffect(NULL); - - // circle w/ emboss & transparent (exercises 3dshader) - canvas->translate(SkIntToScalar(50), 0); - paint.setMaskFilter(embossFilter)->unref(); - canvas->drawOval(rect, paint); - canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); - paint.setShader(transparentShader)->unref(); - canvas->drawOval(rect, paint); - canvas->translate(0, SkIntToScalar(-10)); - - // path - canvas->translate(SkIntToScalar(50), 0); - paint.setColor(SK_ColorRED); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(5)); - paint.setShader(radial)->unref(); - paint.setMaskFilter(NULL); - canvas->drawPath(path, paint); - - paint.setShader(NULL); - // bitmap, sprite - canvas->translate(SkIntToScalar(50), 0); - paint.setStyle(SkPaint::kFill_Style); - canvas->drawBitmap(fBug, left, top, &paint); - canvas->translate(SkIntToScalar(30), 0); - canvas->drawSprite(fTb, - SkScalarRound(canvas->getTotalMatrix().getTranslateX()), - spriteOffset + 10, &paint); - - canvas->translate(-SkIntToScalar(30), SkIntToScalar(30)); - paint.setShader(shaderTest())->unref(); // test compose shader - canvas->drawRect(rect2, paint); - paint.setShader(NULL); - - canvas->restore(); - // text - canvas->translate(0, SkIntToScalar(60)); - canvas->save(); - paint.setColor(SK_ColorGRAY); - canvas->drawPosText(ascii, asciiLength, pos.begin(), paint); - canvas->drawPosText(ascii, asciiLength, pos2.begin(), paint); - - canvas->translate(SkIntToScalar(50), 0); - paint.setColor(SK_ColorCYAN); - canvas->drawText(utf8, sizeof(utf8) - 1, x, y, paint); - - canvas->translate(SkIntToScalar(30), 0); - paint.setColor(SK_ColorMAGENTA); - paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); - matrix.setTranslate(SkIntToScalar(10), SkIntToScalar(10)); - canvas->drawTextOnPath((void*) utf16, sizeof(utf16), path, &matrix, paint); - canvas->translate(0, SkIntToScalar(20)); - canvas->drawTextOnPath((void*) utf16simple, sizeof(utf16simple), path, &matrix, paint); - canvas->restore(); - - canvas->translate(0, SkIntToScalar(60)); - paint.setTextEncoding(SkPaint::kUTF8_TextEncoding); - canvas->restore(); - } - - /* -./SkColorFilter.h:25:class SkColorFilter : public SkFlattenable { -- abstract - static SkColorFilter* CreatXfermodeFilter() *** untested *** - static SkColorFilter* CreatePorterDuffFilter() *** untested *** - static SkColorFilter* CreateLightingFilter() -- tested -./SkDrawLooper.h:9:class SkDrawLooper : public SkFlattenable { -- virtually abstract - ./SkBlurDrawLooper.h:9:class SkBlurDrawLooper : public SkDrawLooper { *** untested *** -./SkMaskFilter.h:41:class SkMaskFilter : public SkFlattenable { -- abstract chmod +w .h - ./SkEmbossMaskFilter.h:27:class SkEmbossMaskFilter : public SkMaskFilter { -- tested -./SkPathEffect.h:33:class SkPathEffect : public SkFlattenable { -- abstract - ./Sk1DPathEffect.h:27:class Sk1DPathEffect : public SkPathEffect { -- abstract - ./Sk1DPathEffect.h:48:class SkPath1DPathEffect : public Sk1DPathEffect { -- tested - ./Sk2DPathEffect.h:25:class Sk2DPathEffect : public SkPathEffect { *** untested *** - ./SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect { *** untested *** - ./SkDashPathEffect.h:27:class SkDashPathEffect : public SkPathEffect { - ./SkDiscretePathEffect.h:27:class SkDiscretePathEffect : public SkPathEffect { - ./SkPaint.h:760:class SkStrokePathEffect : public SkPathEffect { - ./SkPathEffect.h:58:class SkPairPathEffect : public SkPathEffect { - ./SkPathEffect.h:78:class SkComposePathEffect : public SkPairPathEffect { - ./SkPathEffect.h:114:class SkSumPathEffect : public SkPairPathEffect { -./SkRasterizer.h:29:class SkRasterizer : public SkFlattenable { - ./SkLayerRasterizer.h:27:class SkLayerRasterizer : public SkRasterizer { -./SkShader.h:36:class SkShader : public SkFlattenable { - ./SkColorFilter.h:59:class SkFilterShader : public SkShader { - ./SkColorShader.h:26:class SkColorShader : public SkShader { - ./SkShaderExtras.h:31:class SkComposeShader : public SkShader { - ./SkTransparentShader.h:23:class SkTransparentShader : public SkShader { -./SkUnitMapper.h:24:class SkUnitMapper : public SkFlattenable { - ./SkUnitMapper.h:33:class SkDiscreteMapper : public SkUnitMapper { - ./SkUnitMapper.h:51:class SkFlipCosineMapper : public SkUnitMapper { -./SkXfermode.h:32:class SkXfermode : public SkFlattenable { - ./SkAvoidXfermode.h:28:class SkAvoidXfermode : public SkXfermode { *** not done *** chmod +w .h .cpp - ./SkXfermode.h:54:class SkProcXfermode : public SkXfermode { - */ - - /* -./SkBlurMaskFilter.h:25:class SkBlurMaskFilter { - chmod +w SkBlurMaskFilter.cpp -./SkGradientShader.h:30:class SkGradientShader { - */ - // save layer, bounder, looper - // matrix - // clip /path/region - // bitmap proc shader ? - -/* untested: -SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect { -*/ - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - fClickPt.set(x, y); - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - SkPathEffect* pathEffectTest() - { - static const int gXY[] = { 1, 0, 0, -1, 2, -1, 3, 0, 2, 1, 0, 1 }; - SkScalar gPhase = 0; - SkPath path; - path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1])); - for (unsigned i = 2; i < SK_ARRAY_COUNT(gXY); i += 2) - path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1])); - path.close(); - path.offset(SkIntToScalar(-6), 0); - SkPathEffect* outer = new SkPath1DPathEffect(path, SkIntToScalar(12), - gPhase, SkPath1DPathEffect::kRotate_Style); - SkPathEffect* inner = new SkDiscretePathEffect(SkIntToScalar(2), - SkIntToScalar(1)/10); // SkCornerPathEffect(SkIntToScalar(2)); - SkPathEffect* result = new SkComposePathEffect(outer, inner); - outer->unref(); - inner->unref(); - return result; - } - - SkPathEffect* pathEffectTest2() // unsure this works (has no visible effect) - { - SkPathEffect* outer = new SkStrokePathEffect(SkIntToScalar(4), - SkPaint::kStroke_Style, SkPaint::kMiter_Join, SkPaint::kButt_Cap); - static const SkScalar intervals[] = {SkIntToScalar(1), SkIntToScalar(2), - SkIntToScalar(2), SkIntToScalar(1)}; - SkPathEffect* inner = new SkDashPathEffect(intervals, - sizeof(intervals) / sizeof(intervals[0]), 0); - SkPathEffect* result = new SkSumPathEffect(outer, inner); - outer->unref(); - inner->unref(); - return result; - } - - SkShader* shaderTest() - { - SkPoint pts[] = {0, 0, SkIntToScalar(100), 0 }; - SkColor colors[] = { SK_ColorRED, SK_ColorBLUE }; - SkShader* shaderA = SkGradientShader::CreateLinear(pts, colors, NULL, - 2, SkShader::kClamp_TileMode); - pts[1].set(0, SkIntToScalar(100)); - SkColor colors2[] = {SK_ColorBLACK, SkColorSetARGB(0x80, 0, 0, 0)}; - SkShader* shaderB = SkGradientShader::CreateLinear(pts, colors2, NULL, - 2, SkShader::kClamp_TileMode); - SkXfermode* mode = SkPorterDuff::CreateXfermode(SkPorterDuff::kDstIn_Mode); - SkShader* result = new SkComposeShader(shaderA, shaderB, mode); - shaderA->unref(); - shaderB->unref(); - mode->unref(); - return result; - } - - virtual void startTest() { - SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/bugcirc.gif", &fBug); - SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/tbcirc.gif", &fTb); - SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/05psp04.gif", &fTx); - } - - void drawRaster(SkCanvas* canvas) - { - for (int index = 0; index < SK_ARRAY_COUNT(gRastProcs); index++) - drawOneRaster(canvas); - } - - void drawOneRaster(SkCanvas* canvas) - { - canvas->save(); -// canvas->scale(SK_Scalar1*2, SK_Scalar1*2, 0, 0); - - SkScalar x = SkIntToScalar(20); - SkScalar y = SkIntToScalar(40); - SkPaint paint; - - paint.setAntiAlias(true); - paint.setTextSize(SkIntToScalar(48)); - paint.setTypeface(SkTypeface::Create("sans-serif", SkTypeface::kBold)); - - SkString str("GOOGLE"); - - for (int i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) - { - apply_shader(&paint, i); - - // paint.setMaskFilter(NULL); - // paint.setColor(SK_ColorBLACK); - -#if 01 - int index = i % SK_ARRAY_COUNT(gLightingColors); - paint.setColorFilter(SkColorFilter::CreateLightingFilter( - gLightingColors[index].fMul, - gLightingColors[index].fAdd))->unref(); -#endif - - canvas->drawText(str.c_str(), str.size(), x, y, paint); - SkRect oval = { x, y - SkIntToScalar(40), x + SkIntToScalar(40), y }; - paint.setStyle(SkPaint::kStroke_Style); - canvas->drawOval(oval, paint); - paint.setStyle(SkPaint::kFill_Style); - if (0) - { - SkPath path; - paint.getTextPath(str.c_str(), str.size(), x + SkIntToScalar(260), y, &path); - canvas->drawPath(path, paint); - } - - y += paint.getFontSpacing(); - } - - canvas->restore(); - - if (0) - { - SkPoint pts[] = { 0, 0, 0, SkIntToScalar(150) }; - SkColor colors[] = { 0xFFE6E6E6, 0xFFFFFFFF }; - SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode); - - paint.reset(); - paint.setShader(s)->unref(); - canvas->drawRectCoords(0, 0, SkIntToScalar(120), SkIntToScalar(150), paint); - } - - if (1) - { - SkAvoidXfermode mode(SK_ColorWHITE, 0xFF, - SkAvoidXfermode::kTargetColor_Mode); - SkPaint paint; - x += SkIntToScalar(20); - SkRect r = { x, 0, x + SkIntToScalar(360), SkIntToScalar(700) }; - paint.setXfermode(&mode); - paint.setColor(SK_ColorGREEN); - paint.setAntiAlias(true); - canvas->drawOval(r, paint); - } - } - -private: - SkPoint fClickPt; - SkBitmap fBug, fTb, fTx; - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new DemoView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp deleted file mode 100644 index 3a81902..0000000 --- a/samplecode/SampleApp.cpp +++ /dev/null @@ -1,607 +0,0 @@ -#include "SkCanvas.h" -#include "SkDevice.h" -#include "SkGLCanvas.h" -#include "SkGraphics.h" -#include "SkImageEncoder.h" -#include "SkPaint.h" -#include "SkPicture.h" -#include "SkStream.h" -#include "SkWindow.h" - -#include "SampleCode.h" - -//#define SK_SUPPORT_GL - -#ifdef SK_SUPPORT_GL -#include <AGL/agl.h> -#include <OpenGL/gl.h> -#endif - -#define ANIMATING_EVENTTYPE "nextSample" -#define ANIMATING_DELAY 750 - -#define USE_OFFSCREEN - -SkViewRegister* SkViewRegister::gHead; -SkViewRegister::SkViewRegister(SkViewFactory fact) : fFact(fact) { - static bool gOnce; - if (!gOnce) { - gHead = NULL; - gOnce = true; - } - - fChain = gHead; - gHead = this; -} - -#ifdef SK_SUPPORT_GL -static AGLContext gAGLContext; - -static void init_gl(WindowRef wref) { - GLint major, minor; - - aglGetVersion(&major, &minor); - SkDebugf("---- agl version %d %d\n", major, minor); - - const GLint pixelAttrs[] = { - AGL_RGBA, - AGL_DEPTH_SIZE, 32, - AGL_OFFSCREEN, - AGL_NONE - }; - - AGLPixelFormat format = aglCreatePixelFormat(pixelAttrs); - SkDebugf("----- agl format %p\n", format); - gAGLContext = aglCreateContext(format, NULL); - SkDebugf("----- agl context %p\n", gAGLContext); - aglDestroyPixelFormat(format); - - aglEnable(gAGLContext, GL_BLEND); - aglEnable(gAGLContext, GL_LINE_SMOOTH); - aglEnable(gAGLContext, GL_POINT_SMOOTH); - aglEnable(gAGLContext, GL_POLYGON_SMOOTH); - - aglSetCurrentContext(gAGLContext); -} - -static void setup_offscreen_gl(const SkBitmap& offscreen, WindowRef wref) { - GLboolean success = true; - -#ifdef USE_OFFSCREEN - success = aglSetOffScreen(gAGLContext, - offscreen.width(), - offscreen.height(), - offscreen.rowBytes(), - offscreen.getPixels()); -#else - success = aglSetWindowRef(gAGLContext, wref); -#endif - - GLenum err = aglGetError(); - if (err) { - SkDebugf("---- setoffscreen %d %d %s [%d %d]\n", success, err, - aglErrorString(err), offscreen.width(), offscreen.height()); - } - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE); - glEnable(GL_TEXTURE_2D); - - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); -} -#endif - -////////////////////////////////////////////////////////////////////////////// - -static const char gTitleEvtName[] = "SampleCode_Title_Event"; -static const char gPrefSizeEvtName[] = "SampleCode_PrefSize_Event"; - -bool SampleCode::TitleQ(const SkEvent& evt) { - return evt.isType(gTitleEvtName, sizeof(gTitleEvtName) - 1); -} - -void SampleCode::TitleR(SkEvent* evt, const char title[]) { - SkASSERT(evt && TitleQ(*evt)); - evt->setString(gTitleEvtName, title); -} - -bool SampleCode::PrefSizeQ(const SkEvent& evt) { - return evt.isType(gPrefSizeEvtName, sizeof(gPrefSizeEvtName) - 1); -} - -void SampleCode::PrefSizeR(SkEvent* evt, SkScalar width, SkScalar height) { - SkASSERT(evt && PrefSizeQ(*evt)); - SkScalar size[2]; - size[0] = width; - size[1] = height; - evt->setScalars(gPrefSizeEvtName, 2, size); -} - -////////////////////////////////////////////////////////////////////////////// - -class SampleWindow : public SkOSWindow { -public: - SampleWindow(void* hwnd); - virtual ~SampleWindow(); - -protected: - virtual void onDraw(SkCanvas* canvas); - virtual bool onHandleKey(SkKey key); - virtual bool onHandleChar(SkUnichar); - virtual void onSizeChange(); - - virtual SkCanvas* beforeChildren(SkCanvas*); - virtual void afterChildren(SkCanvas*); - - virtual bool onEvent(const SkEvent& evt); - -#if 0 - virtual bool handleChar(SkUnichar uni); - virtual bool handleEvent(const SkEvent& evt); - virtual bool handleKey(SkKey key); - virtual bool handleKeyUp(SkKey key); - - virtual bool onClick(Click* click); - virtual Click* onFindClickHandler(SkScalar x, SkScalar y); - virtual bool onHandleKeyUp(SkKey key); -#endif -private: - const SkViewRegister* fCurr; - - SkPicture* fPicture; - SkGLCanvas* fGLCanvas; - SkPath fClipPath; - - enum CanvasType { - kRaster_CanvasType, - kPicture_CanvasType, - kOpenGL_CanvasType - }; - CanvasType fCanvasType; - - bool fUseClip; - bool fRepeatDrawing; - bool fAnimating; - - int fScrollTestX, fScrollTestY; - - void loadView(SkView*); - void updateTitle(); - bool nextSample(); - - void postAnimatingEvent() { - if (fAnimating) { - SkEvent* evt = new SkEvent(ANIMATING_EVENTTYPE); - evt->post(this->getSinkID(), ANIMATING_DELAY); - } - } - - - static CanvasType cycle_canvastype(CanvasType); - - typedef SkOSWindow INHERITED; -}; - -SampleWindow::CanvasType SampleWindow::cycle_canvastype(CanvasType ct) { - static const CanvasType gCT[] = { - kPicture_CanvasType, - kOpenGL_CanvasType, - kRaster_CanvasType - }; - return gCT[ct]; -} - -SampleWindow::SampleWindow(void* hwnd) : INHERITED(hwnd) { -#ifdef SK_SUPPORT_GL - init_gl((WindowRef)hwnd); -#endif - - fPicture = NULL; - fGLCanvas = NULL; - - fCanvasType = kRaster_CanvasType; - fUseClip = false; - fRepeatDrawing = false; - fAnimating = false; - - fScrollTestX = fScrollTestY = 0; - -// this->setConfig(SkBitmap::kRGB_565_Config); - this->setConfig(SkBitmap::kARGB_8888_Config); - this->setVisibleP(true); - - fCurr = SkViewRegister::Head(); - this->loadView(fCurr->factory()()); -} - -SampleWindow::~SampleWindow() { - delete fPicture; - delete fGLCanvas; -} - -void SampleWindow::onDraw(SkCanvas* canvas) { - if (fRepeatDrawing) { - this->inval(NULL); - } -} - -#include "SkColorPriv.h" - -static void reverseRedAndBlue(const SkBitmap& bm) { - SkASSERT(bm.config() == SkBitmap::kARGB_8888_Config); - uint8_t* p = (uint8_t*)bm.getPixels(); - uint8_t* stop = p + bm.getSize(); - while (p < stop) { - // swap red/blue (to go from ARGB(int) to RGBA(memory) and premultiply - unsigned scale = SkAlpha255To256(p[3]); - unsigned r = p[2]; - unsigned b = p[0]; - p[0] = SkAlphaMul(r, scale); - p[1] = SkAlphaMul(p[1], scale); - p[2] = SkAlphaMul(b, scale); - p += 4; - } -} - -SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) { -#ifdef SK_SUPPORT_GL -#ifndef USE_OFFSCREEN - aglSetWindowRef(gAGLContext, NULL); -#endif -#endif - switch (fCanvasType) { - case kRaster_CanvasType: - canvas = this->INHERITED::beforeChildren(canvas); - break; - case kPicture_CanvasType: - fPicture = new SkPicture; - canvas = fPicture->beginRecording(9999, 9999); - break; -#ifdef SK_SUPPORT_GL - case kOpenGL_CanvasType: { - //SkGLCanvas::DeleteAllTextures(); // just for testing - SkDevice* device = canvas->getDevice(); - const SkBitmap& bitmap = device->accessBitmap(true); - // first clear the raster bitmap, so we don't see any leftover bits - bitmap.eraseColor(0); - // now setup our glcanvas - setup_offscreen_gl(bitmap, (WindowRef)this->getHWND()); - fGLCanvas = new SkGLCanvas; - fGLCanvas->setViewport(bitmap.width(), bitmap.height()); - canvas = fGLCanvas; - break; - } -#endif - } - - if (fUseClip) { - canvas->drawColor(0xFFFF88FF); - canvas->clipPath(fClipPath); - } - - return canvas; -} - -static void paint_rgn(const SkBitmap& bm, const SkIRect& r, - const SkRegion& rgn) { - SkCanvas canvas(bm); - SkRegion inval(rgn); - - inval.translate(r.fLeft, r.fTop); - canvas.clipRegion(inval); - canvas.drawColor(0xFFFF8080); -} - -void SampleWindow::afterChildren(SkCanvas* orig) { - switch (fCanvasType) { - case kRaster_CanvasType: - break; - case kPicture_CanvasType: - if (false) { - SkPicture* pict = new SkPicture(*fPicture); - fPicture->unref(); - orig->drawPicture(*pict); - pict->unref(); - } if (true) { - SkDynamicMemoryWStream ostream; - fPicture->serialize(&ostream); - fPicture->unref(); - - SkMemoryStream istream(ostream.getStream(), ostream.getOffset()); - SkPicture pict(&istream); - orig->drawPicture(pict); - } else { - fPicture->draw(orig); - fPicture->unref(); - } - fPicture = NULL; - break; -#ifdef SK_SUPPORT_GL - case kOpenGL_CanvasType: - glFlush(); - delete fGLCanvas; - fGLCanvas = NULL; -#ifdef USE_OFFSCREEN - reverseRedAndBlue(orig->getDevice()->accessBitmap(true)); -#endif - break; -#endif - } - -// if ((fScrollTestX | fScrollTestY) != 0) - { - const SkBitmap& bm = orig->getDevice()->accessBitmap(true); - int dx = fScrollTestX * 7; - int dy = fScrollTestY * 7; - SkIRect r; - SkRegion inval; - - r.set(50, 50, 50+100, 50+100); - bm.scrollRect(&r, dx, dy, &inval); - paint_rgn(bm, r, inval); - } -} - -static SkBitmap::Config gConfigCycle[] = { - SkBitmap::kNo_Config, // none -> none - SkBitmap::kNo_Config, // a1 -> none - SkBitmap::kNo_Config, // a8 -> none - SkBitmap::kNo_Config, // index8 -> none - SkBitmap::kARGB_4444_Config, // 565 -> 4444 - SkBitmap::kARGB_8888_Config, // 4444 -> 8888 - SkBitmap::kRGB_565_Config // 8888 -> 565 -}; - -static SkBitmap::Config cycle_configs(SkBitmap::Config c) { - return gConfigCycle[c]; -} - -bool SampleWindow::nextSample() { - if (fCurr) { - fCurr = fCurr->next(); - if (NULL == fCurr) { - fCurr = SkViewRegister::Head(); - } - this->loadView(fCurr->factory()()); - return true; - } - return false; -} - -bool SampleWindow::onEvent(const SkEvent& evt) { - if (evt.isType(ANIMATING_EVENTTYPE)) { - if (fAnimating) { - this->nextSample(); - this->postAnimatingEvent(); - } - return true; - } - return this->INHERITED::onEvent(evt); -} - -static void cleanup_for_filename(SkString* name) { - char* str = name->writable_str(); - for (int i = 0; i < name->size(); i++) { - switch (str[i]) { - case ':': str[i] = '-'; break; - case '/': str[i] = '-'; break; - case ' ': str[i] = '_'; break; - default: break; - } - } -} - -bool SampleWindow::onHandleChar(SkUnichar uni) { - int dx = 0xFF; - int dy = 0xFF; - - switch (uni) { - case '5': dx = 0; dy = 0; break; - case '8': dx = 0; dy = -1; break; - case '6': dx = 1; dy = 0; break; - case '2': dx = 0; dy = 1; break; - case '4': dx = -1; dy = 0; break; - case '7': dx = -1; dy = -1; break; - case '9': dx = 1; dy = -1; break; - case '3': dx = 1; dy = 1; break; - case '1': dx = -1; dy = 1; break; - - default: - break; - } - - if (0xFF != dx && 0xFF != dy) { - if ((dx | dy) == 0) { - fScrollTestX = fScrollTestY = 0; - } else { - fScrollTestX += dx; - fScrollTestY += dy; - } - this->inval(NULL); - return true; - } - - switch (uni) { - case 'a': - fAnimating = !fAnimating; - this->postAnimatingEvent(); - this->updateTitle(); - return true; - case 'f': { - const char* title = this->getTitle(); - if (title[0] == 0) { - title = "sampleapp"; - } - SkString name(title); - cleanup_for_filename(&name); - name.append(".png"); - if (SkImageEncoder::EncodeFile(name.c_str(), this->getBitmap(), - SkImageEncoder::kPNG_Type, 100)) { - SkDebugf("Created %s\n", name.c_str()); - } - return true; - } - default: - break; - } - - return this->INHERITED::onHandleChar(uni); -} - -#include "SkDumpCanvas.h" - -bool SampleWindow::onHandleKey(SkKey key) { - switch (key) { - case kRight_SkKey: - if (this->nextSample()) { - return true; - } - break; - case kLeft_SkKey: - fCanvasType = cycle_canvastype(fCanvasType); - this->updateTitle(); - this->inval(NULL); - return true; - case kUp_SkKey: - fUseClip = !fUseClip; - this->updateTitle(); - this->inval(NULL); - return true; - case kDown_SkKey: - this->setConfig(cycle_configs(this->getBitmap().config())); - this->updateTitle(); - return true; - case kOK_SkKey: - if (true) { - SkDebugfDumper dumper; - SkDumpCanvas dc(&dumper); - this->draw(&dc); - } else { - fRepeatDrawing = !fRepeatDrawing; - if (fRepeatDrawing) { - this->inval(NULL); - } - } - return true; - default: - break; - } - return this->INHERITED::onHandleKey(key); -} - -void SampleWindow::loadView(SkView* view) { - SkView::F2BIter iter(this); - SkView* prev = iter.next(); - if (prev) { - prev->detachFromParent(); - } - view->setVisibleP(true); - this->attachChildToFront(view)->unref(); - view->setSize(this->width(), this->height()); - - this->updateTitle(); -} - -static const char* gConfigNames[] = { - "unknown config", - "A1", - "A8", - "Index8", - "565", - "4444", - "8888" -}; - -static const char* configToString(SkBitmap::Config c) { - return gConfigNames[c]; -} - -static const char* gCanvasTypePrefix[] = { - "raster: ", - "picture: ", - "opengl: " -}; - -void SampleWindow::updateTitle() { - SkString title; - - SkView::F2BIter iter(this); - SkView* view = iter.next(); - SkEvent evt(gTitleEvtName); - if (view->doQuery(&evt)) { - title.set(evt.findString(gTitleEvtName)); - } - if (title.size() == 0) { - title.set("<unknown>"); - } - - title.prepend(gCanvasTypePrefix[fCanvasType]); - - title.prepend(" "); - title.prepend(configToString(this->getBitmap().config())); - - if (fAnimating) { - title.prepend("<A> "); - } - - this->setTitle(title.c_str()); -} - -void SampleWindow::onSizeChange() { - this->INHERITED::onSizeChange(); - - SkView::F2BIter iter(this); - SkView* view = iter.next(); - view->setSize(this->width(), this->height()); - - // rebuild our clippath - { - const SkScalar W = this->width(); - const SkScalar H = this->height(); - - fClipPath.reset(); -#if 0 - for (SkScalar y = SK_Scalar1; y < H; y += SkIntToScalar(32)) { - SkRect r; - r.set(SK_Scalar1, y, SkIntToScalar(30), y + SkIntToScalar(30)); - for (; r.fLeft < W; r.offset(SkIntToScalar(32), 0)) - fClipPath.addRect(r); - } -#else - SkRect r; - r.set(0, 0, W, H); - fClipPath.addRect(r, SkPath::kCCW_Direction); - r.set(W/4, H/4, W*3/4, H*3/4); - fClipPath.addRect(r, SkPath::kCW_Direction); -#endif - } - - this->updateTitle(); // to refresh our config -} - -/////////////////////////////////////////////////////////////////////////////// - -SkOSWindow* create_sk_window(void* hwnd) { - return new SampleWindow(hwnd); -} - -void get_preferred_size(int* x, int* y, int* width, int* height) { - *x = 10; - *y = 50; - *width = 640; - *height = 480; -} - -void application_init() { -// setenv("ANDROID_ROOT", "../../../data", 0); - setenv("ANDROID_ROOT", "/android/device/data", 0); - SkGraphics::Init(); - SkEvent::Init(); -} - -void application_term() { - SkEvent::Term(); - SkGraphics::Term(); -} diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp deleted file mode 100644 index ada1d0a..0000000 --- a/samplecode/SampleArc.cpp +++ /dev/null @@ -1,187 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkComposeShader.h" -#include "Sk1DPathEffect.h" -#include "SkCornerPathEffect.h" -#include "SkPathMeasure.h" -#include "SkRandom.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkPorterDuff.h" -#include "SkLayerRasterizer.h" - -class ArcsView : public SkView { -public: - ArcsView() - { - fSweep = SkIntToScalar(100); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Arcs"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); - } - - static void drawRectWithLines(SkCanvas* canvas, const SkRect& r, const SkPaint& p) - { - canvas->drawRect(r, p); - canvas->drawLine(r.fLeft, r.fTop, r.fRight, r.fBottom, p); - canvas->drawLine(r.fLeft, r.fBottom, r.fRight, r.fTop, p); - canvas->drawLine(r.fLeft, r.centerY(), r.fRight, r.centerY(), p); - canvas->drawLine(r.centerX(), r.fTop, r.centerX(), r.fBottom, p); - } - - static void draw_label(SkCanvas* canvas, const SkRect& rect, - int start, int sweep) - { - SkPaint paint; - - paint.setAntiAlias(true); - paint.setTextAlign(SkPaint::kCenter_Align); - - SkString str; - - str.appendS32(start); - str.append(", "); - str.appendS32(sweep); - canvas->drawText(str.c_str(), str.size(), rect.centerX(), - rect.fBottom + paint.getTextSize() * 5/4, paint); - } - - static void drawArcs(SkCanvas* canvas) - { - SkPaint paint; - SkRect r; - SkScalar w = SkIntToScalar(75); - SkScalar h = SkIntToScalar(50); - - r.set(0, 0, w, h); - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - - canvas->save(); - canvas->translate(SkIntToScalar(10), SkIntToScalar(300)); - - paint.setStrokeWidth(SkIntToScalar(1)); - - static const int gAngles[] = { - 0, 360, - 0, 45, - 0, -45, - 720, 135, - -90, 269, - -90, 270, - -90, 271, - -180, -270, - 225, 90 - }; - - for (int i = 0; i < SK_ARRAY_COUNT(gAngles); i += 2) - { - paint.setColor(SK_ColorBLACK); - drawRectWithLines(canvas, r, paint); - - paint.setColor(SK_ColorRED); - canvas->drawArc(r, SkIntToScalar(gAngles[i]), - SkIntToScalar(gAngles[i+1]), false, paint); - - draw_label(canvas, r, gAngles[i], gAngles[i+1]); - - canvas->translate(w * 8 / 7, 0); - } - - canvas->restore(); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - SkRect r; - SkPaint paint; - - paint.setAntiAlias(true); - paint.setStrokeWidth(SkIntToScalar(2)); - paint.setStyle(SkPaint::kStroke_Style); - - r.set(0, 0, SkIntToScalar(200), SkIntToScalar(200)); - r.offset(SkIntToScalar(20), SkIntToScalar(20)); - - if (false) { - const SkScalar d = SkIntToScalar(3); - const SkScalar rad[] = { d, d, d, d, d, d, d, d }; - SkPath path; - path.addRoundRect(r, rad); - canvas->drawPath(path, paint); - return; - } - - drawRectWithLines(canvas, r, paint); - - // printf("----- sweep %g %X\n", SkScalarToFloat(fSweep), SkDegreesToRadians(fSweep)); - - - paint.setStyle(SkPaint::kFill_Style); - paint.setColor(0x800000FF); - canvas->drawArc(r, 0, fSweep, true, paint); - - paint.setColor(0x800FF000); - canvas->drawArc(r, 0, fSweep, false, paint); - - paint.setStyle(SkPaint::kStroke_Style); - paint.setColor(SK_ColorRED); - canvas->drawArc(r, 0, fSweep, true, paint); - - paint.setStrokeWidth(0); - paint.setColor(SK_ColorBLUE); - canvas->drawArc(r, 0, fSweep, false, paint); - - fSweep += SK_Scalar1/4; - if (fSweep > SkIntToScalar(360)) - fSweep = 0; - - drawArcs(canvas); - this->inval(NULL); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - // fSweep += SK_Scalar1; - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - SkScalar fSweep; - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new ArcsView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp deleted file mode 100644 index f164e06..0000000 --- a/samplecode/SampleBitmapRect.cpp +++ /dev/null @@ -1,110 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" - -#include "SkImageRef.h" -#include "SkOSFile.h" -#include "SkStream.h" - -#define SPECIFIC_IMAGE "/skimages/main.gif" - -class BitmapRectView : public SkView { -public: - SkBitmap fBitmap; - int fCurrX, fCurrY; - - BitmapRectView() { - SkImageDecoder::DecodeFile(SPECIFIC_IMAGE, &fBitmap); - fCurrX = fCurrY = 0; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SkString str("BitmapRect: "); - str.append(SPECIFIC_IMAGE); - SampleCode::TitleR(evt, str.c_str()); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(SK_ColorGRAY); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - canvas->drawBitmap(fBitmap, 0, 0, NULL); - - SkIRect subset; - const int SRC_WIDTH = 16; - const int SRC_HEIGHT = 16; - - subset.set(0, 0, SRC_WIDTH, SRC_HEIGHT); - subset.offset(fCurrX, fCurrY); - - SkDebugf("---- src x=%d y=%d\n", subset.fLeft, subset.fTop); - - SkRect dst0, dst1; - SkScalar y = SkIntToScalar(fBitmap.height() + 16); - - dst0.set(SkIntToScalar(50), y, - SkIntToScalar(50+SRC_WIDTH), - y + SkIntToScalar(SRC_HEIGHT)); - dst1 = dst0; - dst1.offset(SkIntToScalar(200), 0); - dst1.fRight = dst1.fLeft + 8 * dst0.width(); - dst1.fBottom = dst1.fTop + 8 * dst0.height(); - - canvas->drawBitmapRect(fBitmap, &subset, dst0, NULL); - canvas->drawBitmapRect(fBitmap, &subset, dst1, NULL); - - SkPaint paint; - paint.setColor(0x88FF0000); - canvas->drawRect(dst0, paint); - paint.setColor(0x880000FF); - canvas->drawRect(dst1, paint); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - return new Click(this); - } - - virtual bool onClick(Click* click) - { - fCurrX = click->fICurr.fX; - fCurrY = click->fICurr.fY; - this->inval(NULL); - return true; - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new BitmapRectView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleCamera.cpp b/samplecode/SampleCamera.cpp deleted file mode 100644 index 9a8d1ef..0000000 --- a/samplecode/SampleCamera.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkCamera.h" -#include "SkEmbossMaskFilter.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkRandom.h" - -class CameraView : public SkView { -public: - CameraView() - { - fRX = fRY = fRZ = 0; - } - - virtual ~CameraView() - { - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Camera"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); -// canvas->drawColor(0, SkPorterDuff::kClear_Mode); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - canvas->translate(this->width()/2, this->height()/2); - - Sk3DView view; - view.rotateX(SkIntToScalar(fRX)); - view.rotateY(SkIntToScalar(fRY)); - view.applyToCanvas(canvas); - - SkPaint paint; - SkScalar rad = SkIntToScalar(50); - SkScalar dim = rad*2; - - if (view.dotWithNormal(0, 0, SK_Scalar1) < 0) { - paint.setColor(SK_ColorRED); - } - - paint.setAntiAlias(true); - -#if 0 - SkEmbossMaskFilter::Light light; - light.fDirection[0] = SK_Scalar1; - light.fDirection[1] = SK_Scalar1; - light.fDirection[2] = SK_Scalar1; - light.fAmbient = 180; - light.fSpecular = 16 * 2; - paint.setMaskFilter(new SkEmbossMaskFilter(light, SkIntToScalar(4))); -#endif - - canvas->drawCircle(0, 0, rad, paint); - canvas->drawCircle(-dim, -dim, rad, paint); - canvas->drawCircle(-dim, dim, rad, paint); - canvas->drawCircle( dim, -dim, rad, paint); - canvas->drawCircle( dim, dim, rad, paint); - - fRY += 1; - if (fRY >= 360) - fRY = 0; - this->inval(NULL); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - SkScalar angle = SkScalarDiv(this->height()/2 - y, this->height()); - fRX = SkScalarRound(angle * 180); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - int fRX, fRY, fRZ; - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new CameraView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleCircle.cpp b/samplecode/SampleCircle.cpp deleted file mode 100644 index bfb92d4..0000000 --- a/samplecode/SampleCircle.cpp +++ /dev/null @@ -1,137 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkDevice.h" -#include "SkPaint.h" - -// ensure that we don't accidentally screw up the bounds when the oval is -// fractional, and the impl computes the center and radii, and uses them to -// reconstruct the edges of the circle. -// see bug# 1504910 -static void test_circlebounds(SkCanvas* canvas) { -#ifdef SK_SCALAR_IS_FLOAT - SkRect r = { 1.39999998, 1, 21.3999996, 21 }; - SkPath p; - p.addOval(r); - SkRect r2; - p.computeBounds(&r2, SkPath::kFast_BoundsType); - SkASSERT(r == r2); -#endif -} - -class CircleView : public SkView { -public: - static const SkScalar ANIM_DX = SK_Scalar1 / 67; - static const SkScalar ANIM_DY = SK_Scalar1 / 29; - static const SkScalar ANIM_RAD = SK_Scalar1 / 19; - SkScalar fDX, fDY, fRAD; - - CircleView() { - fDX = fDY = fRAD = 0; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Circles"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - } - - void circle(SkCanvas* canvas, int width, bool aa) { - SkPaint paint; - - paint.setAntiAlias(aa); - if (width < 0) { - paint.setStyle(SkPaint::kFill_Style); - } else { - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(width)); - } - canvas->drawCircle(0, 0, SkIntToScalar(9) + fRAD, paint); - } - - void drawSix(SkCanvas* canvas, SkScalar dx, SkScalar dy) { - for (int width = -1; width <= 1; width++) { - canvas->save(); - circle(canvas, width, false); - canvas->translate(0, dy); - circle(canvas, width, true); - canvas->restore(); - canvas->translate(dx, 0); - } - } - - static void blowup(SkCanvas* canvas, const SkIRect& src, const SkRect& dst) { - SkDevice* device = canvas->getDevice(); - const SkBitmap& bm = device->accessBitmap(false); - canvas->drawBitmapRect(bm, &src, dst, NULL); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - test_circlebounds(canvas); - - if (false) { - // canvas->translate(SK_ScalarHalf, SK_ScalarHalf); - - SkPaint paint; - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - canvas->drawCircle(SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(2), paint); - - SkIRect r; - r.set(7, 7, 13, 13); - SkRect dst; - dst.set(SkIntToScalar(100), SkIntToScalar(10), SkIntToScalar(200), SkIntToScalar(110)); - blowup(canvas, r, dst); - return; - } - - // test that degenerate rects do nothing - if (true) { - SkScalar x = SkIntToScalar(30); - SkRect r; - r.set(x, x, x, x); - SkPaint p; - canvas->drawRect(r, p); - p.setAntiAlias(true); - canvas->drawRect(r, p); - } - - SkScalar dx = SkIntToScalar(32); - SkScalar dy = SkIntToScalar(32); - - canvas->translate(dx + fDX, dy + fDY); - drawSix(canvas, dx, dy); - - canvas->translate(dx, 0); - canvas->translate(SK_ScalarHalf, SK_ScalarHalf); - drawSix(canvas, dx, dy); - - fDX += ANIM_DX; - fDY += ANIM_DY; - fRAD += ANIM_RAD; - this->inval(NULL); - } - -private: - typedef SkView INHERITED; -}; - -const SkScalar CircleView::ANIM_DX; -const SkScalar CircleView::ANIM_DY; -const SkScalar CircleView::ANIM_RAD; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new CircleView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleCode.h b/samplecode/SampleCode.h deleted file mode 100644 index ff660f2..0000000 --- a/samplecode/SampleCode.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef SampleCode_DEFINED -#define SampleCode_DEFINED - -#include "SkEvent.h" - -class SampleCode { -public: - static bool TitleQ(const SkEvent&); - static void TitleR(SkEvent*, const char title[]); - - static bool PrefSizeQ(const SkEvent&); - static void PrefSizeR(SkEvent*, SkScalar width, SkScalar height); -}; - -////////////////////////////////////////////////////////////////////////////// - -class SkView; - -typedef SkView* (*SkViewFactory)(); - -class SkViewRegister : SkNoncopyable { -public: - SkViewRegister(SkViewFactory); - - static const SkViewRegister* Head() { return gHead; } - - SkViewRegister* next() const { return fChain; } - SkViewFactory factory() const { return fFact; } - -private: - SkViewFactory fFact; - SkViewRegister* fChain; - - static SkViewRegister* gHead; -}; - -#endif - diff --git a/samplecode/SampleCull.cpp b/samplecode/SampleCull.cpp deleted file mode 100644 index ea1bb77..0000000 --- a/samplecode/SampleCull.cpp +++ /dev/null @@ -1,230 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkCornerPathEffect.h" -#include "SkCullPoints.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkRandom.h" - -static void addbump(SkPath* path, const SkPoint pts[2], SkScalar bump) -{ - SkVector tang; - - tang.setLength(pts[1].fX - pts[0].fX, pts[1].fY - pts[0].fY, bump); - - path->lineTo(SkScalarHalf(pts[0].fX + pts[1].fX) - tang.fY, - SkScalarHalf(pts[0].fY + pts[1].fY) + tang.fX); - path->lineTo(pts[1]); -} - -static void subdivide(SkPath* path, SkScalar bump) -{ - SkPath::Iter iter(*path, false); - SkPoint pts[4]; - SkPath tmp; - - for (;;) - switch (iter.next(pts)) { - case SkPath::kMove_Verb: - tmp.moveTo(pts[0]); - break; - case SkPath::kLine_Verb: - addbump(&tmp, pts, bump); - bump = -bump; - break; - case SkPath::kDone_Verb: - goto FINISH; - default: - break; - } - -FINISH: - path->swap(tmp); -} - -static SkIPoint* getpts(const SkPath& path, int* count) -{ - SkPoint pts[4]; - int n = 1; - SkIPoint* array; - - { - SkPath::Iter iter(path, false); - for (;;) - switch (iter.next(pts)) { - case SkPath::kLine_Verb: - n += 1; - break; - case SkPath::kDone_Verb: - goto FINISHED; - default: - break; - } - } - -FINISHED: - array = new SkIPoint[n]; - n = 0; - - { - SkPath::Iter iter(path, false); - for (;;) - switch (iter.next(pts)) { - case SkPath::kMove_Verb: - array[n++].set(SkScalarRound(pts[0].fX), SkScalarRound(pts[0].fY)); - break; - case SkPath::kLine_Verb: - array[n++].set(SkScalarRound(pts[1].fX), SkScalarRound(pts[1].fY)); - break; - case SkPath::kDone_Verb: - goto FINISHED2; - default: - break; - } - } - -FINISHED2: - *count = n; - return array; -} - -static SkScalar nextScalarRange(SkRandom& rand, SkScalar min, SkScalar max) -{ - return min + SkScalarMul(rand.nextUScalar1(), max - min); -} - -class CullView : public SkView { -public: - CullView() - { - fClip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160)); - - SkRandom rand; - - for (int i = 0; i < 50; i++) { - int x = nextScalarRange(rand, -fClip.width()*1, fClip.width()*2); - int y = nextScalarRange(rand, -fClip.height()*1, fClip.height()*2); - if (i == 0) - fPath.moveTo(x, y); - else - fPath.lineTo(x, y); - } - - SkScalar bump = fClip.width()/8; - subdivide(&fPath, bump); - subdivide(&fPath, bump); - subdivide(&fPath, bump); - fPoints = getpts(fPath, &fPtCount); - } - - virtual ~CullView() - { - delete[] fPoints; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Culling"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); - - #if 0 - SkPaint paint; - - paint.setAntiAliasOn(true); - paint.setTextSize(SkIntToScalar(20)); - paint.setTypeface(SkTypeface::Create("serif", SkTypeface::kBoldItalic))->unref(); - - uint16_t text[20]; - - text[0] = 'H'; - text[1] = 'i'; - text[2] = ' '; - for (int i = 3; i < 20; i++) - text[i] = 0x3040 + i; - canvas->drawText16(text, 20, SkIntToScalar(20), SkIntToScalar(20), paint); - #endif - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - SkAutoCanvasRestore ar(canvas, true); - - canvas->translate( SkScalarHalf(this->width() - fClip.width()), - SkScalarHalf(this->height() - fClip.height())); - - // canvas->scale(SK_Scalar1*3, SK_Scalar1*3, 0, 0); - - SkPaint paint; - - // paint.setAntiAliasOn(true); - paint.setStyle(SkPaint::kStroke_Style); - - canvas->drawRect(fClip, paint); - -#if 1 - paint.setColor(0xFF555555); - paint.setStrokeWidth(SkIntToScalar(2)); -// paint.setPathEffect(new SkCornerPathEffect(SkIntToScalar(30)))->unref(); - canvas->drawPath(fPath, paint); -// paint.setPathEffect(NULL); -#endif - - SkPath tmp; - SkIRect iclip; - fClip.round(&iclip); - - SkCullPointsPath cpp(iclip, &tmp); - - cpp.moveTo(fPoints[0].fX, fPoints[0].fY); - for (int i = 0; i < fPtCount; i++) - cpp.lineTo(fPoints[i].fX, fPoints[i].fY); - - paint.setColor(SK_ColorRED); - paint.setStrokeWidth(SkIntToScalar(3)); - paint.setStrokeJoin(SkPaint::kRound_Join); - canvas->drawPath(tmp, paint); - - this->inval(NULL); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - SkRect fClip; - SkIPoint* fPoints; - SkPath fPath; - int fPtCount; - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new CullView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleDither.cpp b/samplecode/SampleDither.cpp deleted file mode 100644 index 64af007..0000000 --- a/samplecode/SampleDither.cpp +++ /dev/null @@ -1,197 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "Sk1DPathEffect.h" -#include "SkCornerPathEffect.h" -#include "SkPathMeasure.h" -#include "SkRandom.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkDither.h" - -static void draw_sweep(SkCanvas* c, int width, int height, SkScalar angle) { - SkRect r; - SkPaint p; - - p.setAntiAlias(true); -// p.setDither(true); - p.setStrokeWidth(SkIntToScalar(width/10)); - p.setStyle(SkPaint::kStroke_Style); - - r.set(0, 0, SkIntToScalar(width), SkIntToScalar(height)); - - // SkColor colors[] = { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN, SK_ColorCYAN }; - SkColor colors[] = { 0x4c737373, 0x4c737373, 0xffffd300 }; - SkShader* s = SkGradientShader::CreateSweep(r.centerX(), r.centerY(), - colors, NULL, SK_ARRAY_COUNT(colors)); - p.setShader(s)->unref(); - - SkAutoCanvasRestore acr(c, true); - - c->translate(r.centerX(), r.centerY()); - c->rotate(angle); - c->translate(-r.centerX(), -r.centerY()); - - SkRect bounds = r; - r.inset(p.getStrokeWidth(), p.getStrokeWidth()); - SkRect innerBounds = r; - - if (true) { - c->drawOval(r, p); - } else { - SkScalar x = r.centerX(); - SkScalar y = r.centerY(); - SkScalar radius = r.width() / 2; - SkScalar thickness = p.getStrokeWidth(); - SkScalar sweep = SkFloatToScalar(360.0f); - SkPath path; - - path.moveTo(x + radius, y); - // outer top - path.lineTo(x + radius + thickness, y); - // outer arc - path.arcTo(bounds, 0, sweep, false); - // inner arc - path.arcTo(innerBounds, sweep, -sweep, false); - path.close(); - } -} - -static void make_bm(SkBitmap* bm) -{ - bm->setConfig(SkBitmap::kARGB_8888_Config, 100, 100); - bm->allocPixels(); -#if 0 - bm->eraseColor(SK_ColorBLUE); - return; -#else - bm->eraseColor(0); -#endif - - SkCanvas c(*bm); - draw_sweep(&c, bm->width(), bm->height(), 0); -} - -static void pre_dither(const SkBitmap& bm) -{ - SkAutoLockPixels alp(bm); - - for (unsigned y = 0; y < bm.height(); y++) { - DITHER_4444_SCAN(y); - - SkPMColor* p = bm.getAddr32(0, y); - for (unsigned x = 0; x < bm.width(); x++) { - SkPMColor c = *p; - - unsigned a = SkGetPackedA32(c); - unsigned r = SkGetPackedR32(c); - unsigned g = SkGetPackedG32(c); - unsigned b = SkGetPackedB32(c); - - unsigned d = DITHER_VALUE(x); - - a = SkDITHER_A32To4444(a, d); - r = SkDITHER_R32To4444(r, d); - g = SkDITHER_G32To4444(g, d); - b = SkDITHER_B32To4444(b, d); - - a = SkA4444ToA32(a); - r = SkR4444ToR32(r); - g = SkG4444ToG32(g); - b = SkB4444ToB32(b); - - *p++ = SkPackARGB32(a, r, g, b); - } - } -} - -class DitherView : public SkView { -public: - SkBitmap fBM, fBMPreDither, fBM16; - SkScalar fAngle; - - DitherView() { - make_bm(&fBM); - make_bm(&fBMPreDither); - pre_dither(fBMPreDither); - fBM.copyTo(&fBM16, SkBitmap::kARGB_4444_Config); - - fAngle = 0; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Dither"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(0xFF181818); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkPaint paint; - SkScalar x = SkIntToScalar(10); - SkScalar y = SkIntToScalar(10); - const SkScalar DX = SkIntToScalar(fBM.width() + 10); - - paint.setAntiAlias(true); - - if (true) { - canvas->drawBitmap(fBM, x, y, &paint); - x += DX; - paint.setDither(true); - canvas->drawBitmap(fBM, x, y, &paint); - - x += DX; - paint.setDither(false); - canvas->drawBitmap(fBMPreDither, x, y, &paint); - - x += DX; - canvas->drawBitmap(fBM16, x, y, &paint); - } - - canvas->translate(DX, DX*2); - draw_sweep(canvas, fBM.width(), fBM.height(), fAngle); - canvas->translate(DX, 0); - draw_sweep(canvas, fBM.width()>>1, fBM.height()>>1, fAngle); - canvas->translate(DX, 0); - draw_sweep(canvas, fBM.width()>>2, fBM.height()>>2, fAngle); - - fAngle += SK_Scalar1/2; - this->inval(NULL); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - // fSweep += SK_Scalar1; - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new DitherView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleDrawLooper.cpp b/samplecode/SampleDrawLooper.cpp deleted file mode 100644 index 1a7a870..0000000 --- a/samplecode/SampleDrawLooper.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGraphics.h" -#include "SkRandom.h" -#include "SkLayerDrawLooper.h" -#include "SkBlurMaskFilter.h" - -#include <pthread.h> - -#define WIDTH 200 -#define HEIGHT 200 - -class LooperView : public SkView { -public: - - SkLayerDrawLooper* fLooper; - - LooperView() { - static const struct { - SkColor fColor; - SkPaint::Style fStyle; - SkScalar fWidth; - SkScalar fOffset; - int fBlur; - } gParams[] = { - { SK_ColorWHITE, SkPaint::kStroke_Style, SkIntToScalar(1)*3/4, 0, 0 }, - { SK_ColorRED, SkPaint::kStroke_Style, SkIntToScalar(4), 0, 0 }, - { SK_ColorBLUE, SkPaint::kFill_Style, 0, 0, 0 }, - { 0x88000000, SkPaint::kFill_Style, 0, SkIntToScalar(10), 3 } - }; - - fLooper = new SkLayerDrawLooper; - - for (int i = 0; i < SK_ARRAY_COUNT(gParams); i++) { - SkPaint* paint = fLooper->addLayer(gParams[i].fOffset, - gParams[i].fOffset); - paint->setAntiAlias(true); - paint->setColor(gParams[i].fColor); - paint->setStyle(gParams[i].fStyle); - paint->setStrokeWidth(gParams[i].fWidth); - paint->setTextSize(SkIntToScalar(72)); - if (gParams[i].fBlur > 0) { - SkMaskFilter* mf = SkBlurMaskFilter::Create(SkIntToScalar(gParams[i].fBlur), - SkBlurMaskFilter::kNormal_BlurStyle); - paint->setMaskFilter(mf)->unref(); - } - } - } - - virtual ~LooperView() { - fLooper->safeUnref(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "DrawLooper"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); -// canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkPaint paint; - paint.setLooper(fLooper); - - canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50), - SkIntToScalar(30), paint); - - canvas->drawRectCoords(SkIntToScalar(150), SkIntToScalar(50), - SkIntToScalar(200), SkIntToScalar(100), paint); - - canvas->drawText("Looper", 6, SkIntToScalar(230), SkIntToScalar(100), - paint); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new LooperView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleEmboss.cpp b/samplecode/SampleEmboss.cpp deleted file mode 100644 index d12074f..0000000 --- a/samplecode/SampleEmboss.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "Sk64.h" -#include "SkColorShader.h" -#include "SkEmbossMaskFilter.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkKernel33MaskFilter.h" -#include "SkPath.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkXfermode.h" - -class EmbossView : public SkView { - SkEmbossMaskFilter::Light fLight; -public: - EmbossView() - { - fLight.fDirection[0] = SK_Scalar1; - fLight.fDirection[1] = SK_Scalar1; - fLight.fDirection[2] = SK_Scalar1; - fLight.fAmbient = 128; - fLight.fSpecular = 16*2; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Emboss"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - SkPaint paint; - - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(10)); - paint.setMaskFilter(new SkEmbossMaskFilter(fLight, SkIntToScalar(4)))->unref(); - paint.setShader(new SkColorShader(SK_ColorBLUE))->unref(); - paint.setDither(true); - - canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50), - SkIntToScalar(30), paint); - } - -private: - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new EmbossView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleEncode.cpp b/samplecode/SampleEncode.cpp deleted file mode 100644 index e4197bf..0000000 --- a/samplecode/SampleEncode.cpp +++ /dev/null @@ -1,253 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageEncoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" - -#include "SkImageRef.h" -#include "SkStream.h" - -static void make_image(SkBitmap* bm, SkBitmap::Config config, int configIndex) { - const int width = 98; - const int height = 100; - SkBitmap device; - - device.setConfig(SkBitmap::kARGB_8888_Config, width, height); - device.allocPixels(); - - SkCanvas canvas(device); - SkPaint paint; - - paint.setAntiAlias(true); - canvas.drawColor(SK_ColorRED); - paint.setColor(SK_ColorBLUE); - canvas.drawCircle(SkIntToScalar(width)/2, SkIntToScalar(height)/2, - SkIntToScalar(width)/2, paint); - - bm->setConfig(config, width, height); - switch (config) { - case SkBitmap::kARGB_8888_Config: - bm->swap(device); - break; - case SkBitmap::kRGB_565_Config: { - bm->allocPixels(); - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - *bm->getAddr16(x, y) = SkPixel32ToPixel16(*device.getAddr32(x, y)); - } - } - break; - } - case SkBitmap::kIndex8_Config: { - SkPMColor colors[256]; - for (int i = 0; i < 256; i++) { - if (configIndex & 1) { - colors[i] = SkPackARGB32(255-i, 0, 0, 255-i); - } else { - colors[i] = SkPackARGB32(0xFF, i, 0, 255-i); - } - } - SkColorTable* ctable = new SkColorTable(colors, 256); - bm->allocPixels(ctable); - ctable->unref(); - - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - *bm->getAddr8(x, y) = SkGetPackedR32(*device.getAddr32(x, y)); - } - } - break; - } - default: - break; - } -} - -// configs to build the original bitmap in. Can be at most these 3 -static const SkBitmap::Config gConfigs[] = { - SkBitmap::kARGB_8888_Config, - SkBitmap::kRGB_565_Config, - SkBitmap::kIndex8_Config, // opaque - SkBitmap::kIndex8_Config // alpha -}; - -static const char* const gConfigLabels[] = { - "8888", "565", "Index8", "Index8 alpha" -}; - -// types to encode into. Can be at most these 3. Must match up with gExt[] -static const SkImageEncoder::Type gTypes[] = { - SkImageEncoder::kJPEG_Type, - SkImageEncoder::kPNG_Type -}; - -// must match up with gTypes[] -static const char* const gExt[] = { - ".jpg", ".png" -}; - -static const char* gPath = "/encoded/"; - -static void make_name(SkString* name, int config, int ext) { - name->set(gPath); - name->append(gConfigLabels[config]); - name->append(gExt[ext]); -} - -#include <sys/stat.h> - -class EncodeView : public SkView { -public: - SkBitmap* fBitmaps; - size_t fBitmapCount; - - EncodeView() { - #if 1 - (void)mkdir(gPath, S_IRWXU | S_IRWXG | S_IRWXO); - - fBitmapCount = SK_ARRAY_COUNT(gConfigs); - fBitmaps = new SkBitmap[fBitmapCount]; - for (size_t i = 0; i < fBitmapCount; i++) { - make_image(&fBitmaps[i], gConfigs[i], i); - - for (size_t j = 0; j < SK_ARRAY_COUNT(gExt); j++) { - SkString path; - make_name(&path, i, j); - - // remove any previous run of this file - remove(path.c_str()); - - SkImageEncoder* codec = SkImageEncoder::Create(gTypes[j]); - if (!codec->encodeFile(path.c_str(), fBitmaps[i], 100)) { - SkDebugf("------ failed to encode %s\n", path.c_str()); - remove(path.c_str()); // remove any partial file - } - delete codec; - } - } - #else - fBitmaps = NULL; - fBitmapCount = 0; - #endif - } - - virtual ~EncodeView() { - delete[] fBitmaps; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "ImageEncoder"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); -// canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - if (fBitmapCount == 0) { - return; - } - - SkPaint paint; - if (false) { -// SkColor colors[] = { 0xFE000000, SK_ColorWHITE }; - SkColor colors[] = { SK_ColorRED, SK_ColorBLUE }; - SkShader* shader = SkGradientShader::CreateSweep(SkIntToScalar(50), SkIntToScalar(50), - colors, NULL, 2); - paint.setShader(shader)->unref(); - - SkRect r; - r.set(0, 0, SkIntToScalar(100), SkIntToScalar(100)); - canvas->drawRect(r, paint); - - canvas->translate(SkIntToScalar(200), SkIntToScalar(200)); - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(10)); - canvas->drawOval(r, paint); - return; - } - - paint.setAntiAlias(true); - paint.setTextAlign(SkPaint::kCenter_Align); - - canvas->translate(SkIntToScalar(10), SkIntToScalar(20)); - - SkScalar x = 0, y = 0, maxX = 0; - const int SPACER = 10; - - for (size_t i = 0; i < fBitmapCount; i++) { - canvas->drawText(gConfigLabels[i], strlen(gConfigLabels[i]), - x + SkIntToScalar(fBitmaps[i].width()) / 2, 0, - paint); - y = paint.getTextSize(); - - canvas->drawBitmap(fBitmaps[i], x, y); - - SkScalar yy = y; - for (size_t j = 0; j < SK_ARRAY_COUNT(gExt); j++) { - yy += SkIntToScalar(fBitmaps[i].height() + 10); - - SkBitmap bm; - SkString name; - - make_name(&name, i, j); - - SkImageDecoder::DecodeFile(name.c_str(), &bm); - canvas->drawBitmap(bm, x, yy); - } - - x += SkIntToScalar(fBitmaps[i].width() + SPACER); - if (x > maxX) { - maxX = x; - } - } - - y = (paint.getTextSize() + SkIntToScalar(fBitmaps[0].height())) * 3 / 2; - x = maxX + SkIntToScalar(10); - paint.setTextAlign(SkPaint::kLeft_Align); - - for (size_t j = 0; j < SK_ARRAY_COUNT(gExt); j++) { - canvas->drawText(gExt[j], strlen(gExt[j]), x, y, paint); - y += SkIntToScalar(fBitmaps[0].height() + SPACER); - } - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new EncodeView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleFillType.cpp b/samplecode/SampleFillType.cpp deleted file mode 100644 index bb268cd..0000000 --- a/samplecode/SampleFillType.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkCornerPathEffect.h" -#include "SkCullPoints.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" - -class FillTypeView : public SkView { - SkPath fPath; -public: - FillTypeView() { - const SkScalar radius = SkIntToScalar(45); - fPath.addCircle(SkIntToScalar(50), SkIntToScalar(50), radius); - fPath.addCircle(SkIntToScalar(100), SkIntToScalar(100), radius); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "FillType"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); - } - - void showPath(SkCanvas* canvas, int x, int y, SkPath::FillType ft, - SkScalar scale, const SkPaint& paint) { - - const SkRect r = { 0, 0, SkIntToScalar(150), SkIntToScalar(150) }; - - canvas->save(); - canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); - canvas->clipRect(r); - canvas->drawColor(SK_ColorWHITE); - fPath.setFillType(ft); - canvas->translate(r.centerX(), r.centerY()); - canvas->scale(scale, scale); - canvas->translate(-r.centerX(), -r.centerY()); - canvas->drawPath(fPath, paint); - canvas->restore(); - } - - void showFour(SkCanvas* canvas, SkScalar scale, const SkPaint& paint) { - showPath(canvas, 0, 0, SkPath::kWinding_FillType, - scale, paint); - showPath(canvas, 200, 0, SkPath::kEvenOdd_FillType, - scale, paint); - showPath(canvas, 00, 200, SkPath::kInverseWinding_FillType, - scale, paint); - showPath(canvas, 200, 200, SkPath::kInverseEvenOdd_FillType, - scale, paint); - } - - virtual void onDraw(SkCanvas* canvas) { - drawBG(canvas); - - canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); - - SkPaint paint; - const SkScalar scale = SkIntToScalar(5)/4; - - paint.setAntiAlias(false); - - showFour(canvas, SK_Scalar1, paint); - canvas->translate(SkIntToScalar(450), 0); - showFour(canvas, scale, paint); - - paint.setAntiAlias(true); - - canvas->translate(SkIntToScalar(-450), SkIntToScalar(450)); - showFour(canvas, SK_Scalar1, paint); - canvas->translate(SkIntToScalar(450), 0); - showFour(canvas, scale, paint); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new FillTypeView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleFilter.cpp b/samplecode/SampleFilter.cpp deleted file mode 100644 index 49d9c48..0000000 --- a/samplecode/SampleFilter.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "Sk1DPathEffect.h" -#include "SkCornerPathEffect.h" -#include "SkPathMeasure.h" -#include "SkRandom.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkDither.h" - -static void make_bm(SkBitmap* bm) -{ - const SkColor colors[] = { - SK_ColorRED, SK_ColorGREEN, - SK_ColorBLUE, SK_ColorWHITE - }; - SkColorTable* ctable = new SkColorTable(colors, 4); - bm->setConfig(SkBitmap::kIndex8_Config, 2, 2); - bm->allocPixels(ctable); - ctable->unref(); - - *bm->getAddr8(0, 0) = 0; - *bm->getAddr8(1, 0) = 1; - *bm->getAddr8(0, 1) = 2; - *bm->getAddr8(1, 1) = 3; -} - -static SkScalar draw_bm(SkCanvas* canvas, const SkBitmap& bm, - SkScalar x, SkScalar y, SkPaint* paint) -{ -#if 1 - canvas->drawBitmap(bm, x, y, paint); - return SkIntToScalar(bm.width()) * 5/4; -#else - SkRect r; - - r.set(x, y, - x + SkIntToScalar(bm.width() * 2), - y + SkIntToScalar(bm.height() * 2)); - SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, - SkShader::kRepeat_TileMode); - paint->setShader(s)->unref(); - canvas->drawRect(r, *paint); - paint->setShader(NULL); - return r.width() * 5/4; -#endif -} - -static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, SkPaint* p) -{ - x += draw_bm(c, bm, x, 0, p); - p->setFilterBitmap(true); - x += draw_bm(c, bm, x, 0, p); - p->setDither(true); - return x + draw_bm(c, bm, x, 0, p); -} - -static const char* gConfigNames[] = { - "unknown config", - "A1", - "A8", - "Index8", - "565", - "4444", - "8888" -}; - -static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) -{ - SkAutoCanvasRestore acr(canvas, true); - - SkPaint paint; - SkScalar x = 0; - const int scale = 32; - - paint.setAntiAlias(true); - const char* name = gConfigNames[bm.config()]; - canvas->drawText(name, strlen(name), x, SkIntToScalar(bm.height())*scale*5/8, - paint); - canvas->translate(SkIntToScalar(48), 0); - - canvas->scale(SkIntToScalar(scale), SkIntToScalar(scale)); - - x += draw_set(canvas, bm, 0, &paint); - paint.reset(); - paint.setAlpha(0x80); - draw_set(canvas, bm, x, &paint); - return x * scale / 3; -} - -class FilterView : public SkView { -public: - SkBitmap fBM8, fBM4444, fBM16, fBM32; - - FilterView() - { - make_bm(&fBM8); - fBM8.copyTo(&fBM4444, SkBitmap::kARGB_4444_Config); - fBM8.copyTo(&fBM16, SkBitmap::kRGB_565_Config); - fBM8.copyTo(&fBM32, SkBitmap::kARGB_8888_Config); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Filter"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - SkScalar x = SkIntToScalar(10); - SkScalar y = SkIntToScalar(10); - - canvas->translate(x, y); - y = draw_row(canvas, fBM8); - canvas->translate(0, y); - y = draw_row(canvas, fBM4444); - canvas->translate(0, y); - y = draw_row(canvas, fBM16); - canvas->translate(0, y); - draw_row(canvas, fBM32); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - // fSweep += SK_Scalar1; - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new FilterView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleFilter2.cpp b/samplecode/SampleFilter2.cpp deleted file mode 100644 index 1800eb9..0000000 --- a/samplecode/SampleFilter2.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" - -static const char* gNames[] = { - "/skimages/background_01.png" -}; - -class Filter2View : public SkView { -public: - SkBitmap* fBitmaps; - int fBitmapCount; - int fCurrIndex; - - Filter2View() { - fBitmapCount = SK_ARRAY_COUNT(gNames)*2; - fBitmaps = new SkBitmap[fBitmapCount]; - - for (int i = 0; i < fBitmapCount/2; i++) { - SkImageDecoder::DecodeFile(gNames[i], &fBitmaps[i], - SkBitmap::kARGB_8888_Config, - SkImageDecoder::kDecodePixels_Mode); - } - for (int i = fBitmapCount/2; i < fBitmapCount; i++) { - SkImageDecoder::DecodeFile(gNames[i-fBitmapCount/2], &fBitmaps[i], - SkBitmap::kRGB_565_Config, - SkImageDecoder::kDecodePixels_Mode); - } - fCurrIndex = 0; - } - - virtual ~Filter2View() { - delete[] fBitmaps; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SkString str("Filter/Dither "); - str.append(gNames[fCurrIndex]); - SampleCode::TitleR(evt, str.c_str()); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(SK_ColorGRAY); -// canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - canvas->translate(SkIntToScalar(10), SkIntToScalar(50)); - - const SkScalar W = SkIntToScalar(fBitmaps[0].width() + 1); - const SkScalar H = SkIntToScalar(fBitmaps[0].height() + 1); - SkPaint paint; - - const SkScalar scale = SkFloatToScalar(0.897917f); - canvas->scale(SK_Scalar1, scale); - - for (int k = 0; k < 2; k++) { - paint.setFilterBitmap(k == 1); - for (int j = 0; j < 2; j++) { - paint.setDither(j == 1); - for (int i = 0; i < fBitmapCount; i++) { - SkScalar x = (k * fBitmapCount + j) * W; - SkScalar y = i * H; - x = SkIntToScalar(SkScalarRound(x)); - y = SkIntToScalar(SkScalarRound(y)); - canvas->drawBitmap(fBitmaps[i], x, y, &paint); - if (i == 0) { - SkPaint p; - p.setAntiAlias(true); - p.setTextAlign(SkPaint::kCenter_Align); - p.setTextSize(SkIntToScalar(18)); - SkString s("dither="); - s.appendS32(paint.isDither()); - s.append(" filter="); - s.appendS32(paint.isFilterBitmap()); - canvas->drawText(s.c_str(), s.size(), x + W/2, - y - p.getTextSize(), p); - } - if (k+j == 2) { - SkPaint p; - p.setAntiAlias(true); - p.setTextSize(SkIntToScalar(18)); - SkString s; - s.append(" depth="); - s.appendS32(fBitmaps[i].config() == SkBitmap::kRGB_565_Config ? 16 : 32); - canvas->drawText(s.c_str(), s.size(), x + W + SkIntToScalar(4), - y + H/2, p); - } - } - } - } - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new Filter2View; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleFontCache.cpp b/samplecode/SampleFontCache.cpp deleted file mode 100644 index fb63f71..0000000 --- a/samplecode/SampleFontCache.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGraphics.h" -#include "SkRandom.h" - -#include <pthread.h> - -static void call_measure() -{ - SkPaint paint; - uint16_t text[32]; - SkRandom rand; - - paint.setAntiAlias(true); - paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); - for (int j = 0; j < SK_ARRAY_COUNT(text); j++) - text[j] = (uint16_t)((rand.nextU() & 0xFF) + 32); - - for (int i = 9; i < 36; i++) - { - SkPaint::FontMetrics m; - - paint.setTextSize(SkIntToScalar(i)); - paint.getFontMetrics(&m); - paint.measureText(text, sizeof(text)); - } -} - -static void call_draw(SkCanvas* canvas) -{ - SkPaint paint; - uint16_t text[32]; - SkRandom rand; - - paint.setAntiAlias(true); - paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); - for (int j = 0; j < SK_ARRAY_COUNT(text); j++) - text[j] = (uint16_t)((rand.nextU() & 0xFF) + 32); - - SkScalar x = SkIntToScalar(10); - SkScalar y = SkIntToScalar(20); - - canvas->drawColor(SK_ColorWHITE); - for (int i = 9; i < 36; i++) - { - SkPaint::FontMetrics m; - - paint.setTextSize(SkIntToScalar(i)); - paint.getFontMetrics(&m); - canvas->drawText(text, sizeof(text), x, y, paint); - y += m.fDescent - m.fAscent; - } -} - -static bool gDone; - -static void* measure_proc(void* context) -{ - while (!gDone) - { - call_measure(); - } - return NULL; -} - -static void* draw_proc(void* context) -{ - SkBitmap* bm = (SkBitmap*)context; - SkCanvas canvas(*bm); - - while (!gDone) - { - call_draw(&canvas); - } - return NULL; -} - -class FontCacheView : public SkView { -public: - enum { N = 4 }; - - pthread_t fMThreads[N]; - pthread_t fDThreads[N]; - SkBitmap fBitmaps[N]; - - FontCacheView() - { - gDone = false; - for (int i = 0; i < N; i++) - { - int status; - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - SkASSERT(0 == status); - status = pthread_create(&fMThreads[i], &attr, measure_proc, NULL); - SkASSERT(0 == status); - - fBitmaps[i].setConfig(SkBitmap::kRGB_565_Config, 320, 240); - fBitmaps[i].allocPixels(); - status = pthread_create(&fDThreads[i], &attr, draw_proc, &fBitmaps[i]); - SkASSERT(0 == status); - } - } - - virtual ~FontCacheView() - { - gDone = true; - for (int i = 0; i < N; i++) - { - void* ret; - int status = pthread_join(fMThreads[i], &ret); - SkASSERT(0 == status); - status = pthread_join(fDThreads[i], &ret); - SkASSERT(0 == status); - } - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "FontCache"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); -// canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - SkScalar x = 0; - SkScalar y = 0; - for (int i = 0; i < N; i++) - { - canvas->drawBitmap(fBitmaps[i], x, y); - x += SkIntToScalar(fBitmaps[i].width()); - } - this->inval(NULL); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new FontCacheView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleGL.cpp b/samplecode/SampleGL.cpp deleted file mode 100644 index d020b0e..0000000 --- a/samplecode/SampleGL.cpp +++ /dev/null @@ -1,206 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "Sk64.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkKernel33MaskFilter.h" -#include "SkPath.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkXfermode.h" - -// effects -#include "SkGradientShader.h" -#include "SkShaderExtras.h" -#include "SkUnitMappers.h" - -#include "SkStream.h" -#include "SkXMLParser.h" - -#include "SkGLCanvas.h" - -#include <AGL/agl.h> -#include <OpenGL/gl.h> - -extern void* gSampleWind; - -static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) -{ - bm->setConfig(config, w, h); - bm->allocPixels(); - bm->eraseColor(0); - - SkCanvas canvas(*bm); - SkPoint pts[] = { 0, 0, SkIntToScalar(w), SkIntToScalar(h) }; - SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE }; - SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 }; - SkPaint paint; - - SkUnitMapper* um = NULL; - -// um = new SkCosineMapper; - // um = new SkDiscreteMapper(12); - - SkAutoUnref au(um); - - paint.setAntiAlias(true); - paint.setShader(SkGradientShader::CreateLinear(pts, colors, pos, - SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode, um))->unref(); - - SkRect r; - r.set(0, 0, SkIntToScalar(w), SkIntToScalar(h)); - canvas.drawOval(r, paint); -} - -static void premulBitmap(const SkBitmap& bm) { - for (int y = 0; y < bm.height(); y++) { - SkPMColor* p = bm.getAddr32(0, y); - for (int x = 0; x < bm.width(); x++) { - SkPMColor c = *p; - unsigned a = SkGetPackedA32(c); - unsigned r = SkGetPackedR32(c); - unsigned g = SkGetPackedG32(c); - unsigned b = SkGetPackedB32(c); - - unsigned scale = SkAlpha255To256(a); - r = SkAlphaMul(r, scale); - g = SkAlphaMul(g, scale); - b = SkAlphaMul(b, scale); - *p++ = SkPackARGB32(a, r, g, b); - } - } -} - -class GLView : public SkView { -public: - AGLContext fCtx; - SkBitmap fOffscreen; - SkBitmap fTexture[3]; - - GLView() { - makebm(&fTexture[0], SkBitmap::kARGB_8888_Config, 64, 100); - makebm(&fTexture[1], SkBitmap::kRGB_565_Config, 64, 100); - makebm(&fTexture[2], SkBitmap::kARGB_4444_Config, 64, 100); - - GLint major, minor; - - aglGetVersion(&major, &minor); - SkDebugf("---- version %d %d\n", major, minor); - - GLint attr[] = { - AGL_RGBA, - AGL_DEPTH_SIZE, 32, - AGL_OFFSCREEN, - AGL_NONE - }; - - SkDebugf("------ attr %p %d\n", attr, sizeof(attr)); - AGLPixelFormat format = aglCreatePixelFormat(attr); - SkDebugf("----- format %p\n", format); - fCtx = aglCreateContext(format, 0); - SkDebugf("----- context %p\n", fCtx); - GLboolean success; //= aglSetWindowRef(fCtx, (WindowRef)gSampleWind); -// SkDebugf("----- aglSetWindowRef %d\n", success); - - aglEnable(fCtx, GL_BLEND); - aglEnable(fCtx, GL_LINE_SMOOTH); - aglEnable(fCtx, GL_POINT_SMOOTH); - aglEnable(fCtx, GL_POLYGON_SMOOTH); - - fOffscreen.setConfig(SkBitmap::kARGB_8888_Config, 300, 300); - fOffscreen.allocPixels(); - - success = aglSetOffScreen(fCtx, - fOffscreen.width(), - fOffscreen.height(), - fOffscreen.rowBytes(), - fOffscreen.getPixels()); - GLenum err = aglGetError(); - SkDebugf("---- setoffscreen %d %d %s\n", success, err, aglErrorString(err)); - - aglSetCurrentContext(fCtx); - glOrtho(0, fOffscreen.width(), - fOffscreen.height(), 0, - -1, 1); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE); - - glEnable(GL_TEXTURE_2D); -} - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "GL"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkGLCanvas c(fOffscreen.width(), fOffscreen.height()); - - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); - - SkPaint p; - - p.setAntiAlias(true); - - c.drawColor(SK_ColorWHITE); - - p.setColor(SK_ColorRED); - c.drawCircle(SkIntToScalar(40), SkIntToScalar(40), SkIntToScalar(20), p); - - p.setColor(SK_ColorGREEN); - p.setStrokeWidth(SkIntToScalar(6)); - p.setStrokeCap(SkPaint::kRound_Cap); - c.drawLine(SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(40), SkIntToScalar(50), p); - - // c.scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); - p.setColor(0x880000FF); - c.drawCircle(SkIntToScalar(40), SkIntToScalar(40), SkIntToScalar(20), p); - - for (int i = 0; i < SK_ARRAY_COUNT(fTexture); i++) { - c.drawBitmap(fTexture[i], SkIntToScalar(10), SkIntToScalar(100), NULL); - c.translate(SkIntToScalar(fTexture[i].width()), 0); - } - p.setColor(SK_ColorBLUE); - c.drawRectCoords(SkIntToScalar(10), SkIntToScalar(100), - SkIntToScalar(10+fTexture[0].width()), - SkIntToScalar(100+fTexture[0].height()), - p); - - //////// - glFlush(); - premulBitmap(fOffscreen); - canvas->drawBitmap(fOffscreen, SkIntToScalar(10), SkIntToScalar(10), NULL); - } - -private: - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new GLView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleImage.cpp b/samplecode/SampleImage.cpp deleted file mode 100644 index 4cefd27..0000000 --- a/samplecode/SampleImage.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" - -#include "SkImageRef_GlobalPool.h" -#include "SkStream.h" - -static const char* gNames[] = { - "1.bmp", "1.gif", "1.jpg", "1.png", - "2.bmp", "2.gif", "2.jpg", "2.png" -}; - -// ownership of the stream is transferred -static bool SetImageRef(SkBitmap* bitmap, SkStream* stream, - SkBitmap::Config pref, const char name[] = NULL) -{ - if (SkImageDecoder::DecodeStream(stream, bitmap, pref, - SkImageDecoder::kDecodeBounds_Mode)) { - SkASSERT(bitmap->config() != SkBitmap::kNo_Config); - - SkImageRef* ref = new SkImageRef_GlobalPool(stream, bitmap->config()); - ref->setURI(name); - bitmap->setPixelRef(ref)->unref(); - return true; - } else { - delete stream; - return false; - } -} - -class ImageView : public SkView { -public: - SkBitmap* fBitmaps; - SkShader* fShader; - - ImageView() { - SkImageRef_GlobalPool::SetRAMBudget(32 * 1024); - - int i, N = SK_ARRAY_COUNT(gNames); - fBitmaps = new SkBitmap[N]; - - for (i = 0; i < N; i++) { - SkString str("/skimages/"); - str.append(gNames[i]); - SkFILEStream* stream = new SkFILEStream(str.c_str()); - - SetImageRef(&fBitmaps[i], stream, SkBitmap::kNo_Config, gNames[i]); - if (i & 1) - fBitmaps[i].buildMipMap(); - } - - fShader = SkShader::CreateBitmapShader(fBitmaps[5], - SkShader::kRepeat_TileMode, - SkShader::kRepeat_TileMode); - - if (true) { - SkMatrix m; - - m.setRotate(SkIntToScalar(30)); - fShader->setLocalMatrix(m); - } - -#if 0 - SkImageRef::DumpPool(); - for (i = 0; i < N; i++) { - SkBitmap& bm = fBitmaps[i]; - - SkDebugf("<%s> addr=%p", gNames[i], bm.getPixels()); - bool success = bm.lockPixels(); - SkDebugf(" addr=%d", bm.getPixels()); - if (success) - bm.unlockPixels(); - SkDebugf(" addr=%p", bm.getPixels()); - success = bm.lockPixels(); - SkDebugf(" addr=%d", bm.getPixels()); - if (success) - bm.unlockPixels(); - SkDebugf("\n"); - } - SkImageRef::DumpPool(); -#endif - } - - virtual ~ImageView() { - delete[] fBitmaps; - delete fShader; - - SkImageRef_GlobalPool::DumpPool(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Image"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); -// canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); - - SkScalar x = 0, y = 0; - - for (size_t i = 0; i < SK_ARRAY_COUNT(gNames); i++) { - canvas->drawBitmap(fBitmaps[i], x, y); - x += SkIntToScalar(fBitmaps[i].width() + 10); - } - - canvas->translate(0, SkIntToScalar(120)); - - SkPaint paint; - paint.setShader(fShader); - paint.setFilterBitmap(true); - SkRect r = { 0, 0, SkIntToScalar(300), SkIntToScalar(100) }; - - canvas->drawRect(r, paint); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new ImageView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleImageDir.cpp b/samplecode/SampleImageDir.cpp deleted file mode 100644 index 32a719b..0000000 --- a/samplecode/SampleImageDir.cpp +++ /dev/null @@ -1,319 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkComposeShader.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" - -#include "SkImageRef_GlobalPool.h" -#include "SkOSFile.h" -#include "SkStream.h" - -#include "SkBlurDrawLooper.h" -#include "SkColorMatrixFilter.h" - -static void drawmarshmallow(SkCanvas* canvas) { - SkBitmap bitmap; - SkPaint paint; - SkRect r; - SkMatrix m; - - SkImageDecoder::DecodeFile("/Users/reed/Downloads/3elfs.jpg", &bitmap); - SkShader* s = SkShader::CreateBitmapShader(bitmap, - SkShader::kRepeat_TileMode, - SkShader::kRepeat_TileMode); - paint.setShader(s)->unref(); - m.setTranslate(SkIntToScalar(250), SkIntToScalar(134)); - s->setLocalMatrix(m); - - r.set(SkIntToScalar(250), - SkIntToScalar(134), - SkIntToScalar(250 + 449), - SkIntToScalar(134 + 701)); - paint.setFlags(2); - - canvas->drawRect(r, paint); -} - -static void DrawRoundRect(SkCanvas& canvas) { - bool ret = false; - SkPaint paint; - SkBitmap bitmap; - SkMatrix matrix; - matrix.reset(); - - bitmap.setConfig(SkBitmap::kARGB_8888_Config, 1370, 812); - bitmap.allocPixels(); -#if 0 - SkCanvas canvas; - canvas.setBitmapDevice(bitmap); -#endif - - // set up clipper - SkRect skclip; - skclip.set(SkIntToFixed(284), SkIntToFixed(40), SkIntToFixed(1370), SkIntToFixed(708)); - -// ret = canvas.clipRect(skclip); -// SkASSERT(ret); - - matrix.set(SkMatrix::kMTransX, SkFloatToFixed(-1153.28)); - matrix.set(SkMatrix::kMTransY, SkFloatToFixed(1180.50)); - - matrix.set(SkMatrix::kMScaleX, SkFloatToFixed(0.177171)); - matrix.set(SkMatrix::kMScaleY, SkFloatToFixed(0.177043)); - - matrix.set(SkMatrix::kMSkewX, SkFloatToFixed(0.126968)); - matrix.set(SkMatrix::kMSkewY, SkFloatToFixed(-0.126876)); - - matrix.set(SkMatrix::kMPersp0, SkFloatToFixed(0.0)); - matrix.set(SkMatrix::kMPersp1, SkFloatToFixed(0.0)); - - ret = canvas.concat(matrix); - - paint.setAntiAlias(true); - paint.setColor(0xb2202020); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkFloatToFixed(68.13)); - - SkRect r; - r.set(SkFloatToFixed(-313.714417), SkFloatToFixed(-4.826389), SkFloatToFixed(18014.447266), SkFloatToFixed(1858.154541)); - canvas.drawRoundRect(r, SkFloatToFixed(91.756363), SkFloatToFixed(91.756363), paint); -} - -// ownership of the stream is transferred -static bool SetImageRef(SkBitmap* bitmap, SkStream* stream, - SkBitmap::Config pref, const char name[] = NULL) { -#if 0 - // test buffer streams - SkStream* str = new SkBufferStream(stream, 717); - stream->unref(); - stream = str; -#endif - - SkImageRef* ref = new SkImageRef_GlobalPool(stream, pref, 1); - ref->setURI(name); - if (!ref->getInfo(bitmap)) { - delete ref; - return false; - } - bitmap->setPixelRef(ref)->unref(); - return true; -} - -//#define SPECIFIC_IMAGE "/skimages/72.jpg" -#define SPECIFIC_IMAGE "/Users/reed/Downloads/3elfs.jpg" - -#define IMAGE_DIR "/skimages/" -#define IMAGE_SUFFIX ".gif" - -class ImageDirView : public SkView { -public: - SkBitmap* fBitmaps; - SkString* fStrings; - int fBitmapCount; - int fCurrIndex; - SkScalar fSaturation; - SkScalar fAngle; - - ImageDirView() { - SkImageRef_GlobalPool::SetRAMBudget(320 * 1024); - -#ifdef SPECIFIC_IMAGE - fBitmaps = new SkBitmap[3]; - fStrings = new SkString[3]; - fBitmapCount = 3; - const SkBitmap::Config configs[] = { - SkBitmap::kARGB_8888_Config, - SkBitmap::kRGB_565_Config, - SkBitmap::kARGB_4444_Config - }; - for (int i = 0; i < fBitmapCount; i++) { -#if 1 - SkStream* stream = new SkFILEStream(SPECIFIC_IMAGE); - SetImageRef(&fBitmaps[i], stream, configs[i], SPECIFIC_IMAGE); -#else - SkImageDecoder::DecodeFile(SPECIFIC_IMAGE, &fBitmaps[i]); -#endif - } -#else - int i, N = 0; - SkOSFile::Iter iter(IMAGE_DIR, IMAGE_SUFFIX); - SkString name; - while (iter.next(&name)) { - N += 1; - } - fBitmaps = new SkBitmap[N]; - fStrings = new SkString[N]; - iter.reset(IMAGE_DIR, IMAGE_SUFFIX); - for (i = 0; i < N; i++) { - iter.next(&name); - SkString path(IMAGE_DIR); - path.append(name); - SkStream* stream = new SkFILEStream(path.c_str()); - - SetImageRef(&fBitmaps[i], stream, SkBitmap::kNo_Config, - name.c_str()); - fStrings[i] = name; - } - fBitmapCount = N; -#endif - fCurrIndex = 0; - fDX = fDY = 0; - - fSaturation = SK_Scalar1; - fAngle = 0; - - fScale = SK_Scalar1; - } - - virtual ~ImageDirView() { - delete[] fBitmaps; - delete[] fStrings; - - SkImageRef_GlobalPool::DumpPool(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SkString str("ImageDir: "); -#ifdef SPECIFIC_IMAGE - str.append(SPECIFIC_IMAGE); -#else - str.append(IMAGE_DIR); -#endif - SampleCode::TitleR(evt, str.c_str()); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(SK_ColorGRAY); - canvas->drawColor(SK_ColorWHITE); - } - - SkScalar fScale; - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - if (true) { - canvas->scale(SkIntToScalar(2), SkIntToScalar(2)); - drawmarshmallow(canvas); - return; - } - - if (false) { - SkPaint p; - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SkIntToScalar(4)); - canvas->drawCircle(SkIntToScalar(100), SkIntToScalar(100), SkIntToScalar(50), p); - p.setAntiAlias(true); - canvas->drawCircle(SkIntToScalar(300), SkIntToScalar(100), SkIntToScalar(50), p); - } - if (false) { - SkScalar cx = this->width()/2; - SkScalar cy = this->height()/2; - canvas->translate(cx, cy); - canvas->scale(fScale, fScale); - canvas->translate(-cx, -cy); - DrawRoundRect(*canvas); - return; - } - - SkScalar scale = SK_Scalar1 * 999/1000; -// scale = SK_Scalar1/2; - - canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); - // canvas->scale(scale, scale); - - SkScalar x = SkIntToScalar(32), y = SkIntToScalar(32); - SkPaint paint; - - // x += fDX; - // y += fDY; - -// paint.setLooper(new SkBlurDrawLooper(SkIntToScalar(12), 0, 0, 0xDD000000))->unref(); - -#if 0 - for (int i = 0; i < fBitmapCount; i++) { - SkPaint p; - -#if 1 - const SkScalar cm[] = { - SkIntToScalar(2), 0, 0, 0, SkIntToScalar(-255), - 0, SkIntToScalar(2), 0, 0, SkIntToScalar(-255), - 0, 0, SkIntToScalar(2), 0, SkIntToScalar(-255), - 0, 0, 0, SkIntToScalar(1), 0 - }; - SkColorFilter* cf = new SkColorMatrixFilter(cm); - p.setColorFilter(cf)->unref(); -#endif - - canvas->drawBitmap(fBitmaps[i], x, y, &p); - x += SkIntToScalar(fBitmaps[i].width() + 10); - } - return; -#endif - - canvas->drawBitmap(fBitmaps[fCurrIndex], x, y, &paint); -#ifndef SPECIFIC_IMAGE - if (true) { - fCurrIndex += 1; - if (fCurrIndex >= fBitmapCount) { - fCurrIndex = 0; - } - this->inval(NULL); - } -#endif - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - if (true) { - fCurrIndex += 1; - if (fCurrIndex >= fBitmapCount) - fCurrIndex = 0; - this->inval(NULL); - } - return new Click(this); - } - - virtual bool onClick(Click* click) { - SkScalar center = this->width()/2; - fSaturation = SkScalarDiv(click->fCurr.fX - center, center/2); - center = this->height()/2; - fAngle = SkScalarDiv(click->fCurr.fY - center, center) * 180; - - fDX += click->fCurr.fX - click->fPrev.fX; - fDY += click->fCurr.fY - click->fPrev.fY; - - fScale = SkScalarDiv(click->fCurr.fX, this->width()); - - this->inval(NULL); - return true; - return this->INHERITED::onClick(click); - } - -private: - SkScalar fDX, fDY; - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new ImageDirView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp deleted file mode 100644 index 8666745..0000000 --- a/samplecode/SampleLayers.cpp +++ /dev/null @@ -1,258 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkBlurMaskFilter.h" -#include "SkCamera.h" -#include "SkColorFilter.h" -#include "SkColorPriv.h" -#include "SkDevice.h" -#include "SkGradientShader.h" -#include "SkImageDecoder.h" -#include "SkInterpolator.h" -#include "SkMaskFilter.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkUtils.h" -#include "SkKey.h" -#include "SkPorterDuff.h" -#include "SkXfermode.h" -#include "SkDrawFilter.h" - -static void make_paint(SkPaint* paint) { - SkColor colors[] = { 0, SK_ColorWHITE }; - SkPoint pts[] = { 0, 0, 0, SK_Scalar1*20 }; - SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode); - - paint->setShader(s)->unref(); - paint->setXfermode(SkPorterDuff::CreateXfermode(SkPorterDuff::kDstIn_Mode))->unref(); -} - -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()) { - const SkBitmap& bm = iter.device()->accessBitmap(false); - 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++, - bm.width(), bm.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); - - SkRect r; - - SkPaint p; - p.setAlpha(0x88); - - SkAutoCanvasRestore(canvas, false); - - // create the layers - - r.set(0, 0, SkIntToScalar(100), SkIntToScalar(100)); - canvas->clipRect(r); - - r.fBottom = SkIntToScalar(20); - canvas->saveLayer(&r, NULL, (SkCanvas::SaveFlags)(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag)); - - r.fTop = SkIntToScalar(80); - r.fBottom = SkIntToScalar(100); - canvas->saveLayer(&r, NULL, (SkCanvas::SaveFlags)(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag)); - - // now draw the "content" - - if (true) { - r.set(0, 0, SkIntToScalar(100), SkIntToScalar(100)); - - canvas->saveLayerAlpha(&r, 0x80); - - SkPaint p; - p.setColor(SK_ColorRED); - p.setAntiAlias(true); - canvas->drawOval(r, p); - - dump_layers("inside layer alpha", canvas); - - canvas->restore(); - } else { - r.set(0, 0, SkIntToScalar(100), SkIntToScalar(100)); - - SkPaint p; - p.setColor(SK_ColorRED); - p.setAntiAlias(true); - canvas->drawOval(r, p); - } - -// return; - - dump_layers("outside layer alpha", canvas); - - // now apply an effect - - SkPaint paint; - make_paint(&paint); - r.set(0, 0, SkIntToScalar(100), SkIntToScalar(20)); -// SkDebugf("--------- draw top grad\n"); - canvas->drawRect(r, paint); - - SkMatrix m; - SkShader* s = paint.getShader(); - m.setScale(SK_Scalar1, -SK_Scalar1); - m.postTranslate(0, SkIntToScalar(100)); - s->setLocalMatrix(m); - - r.fTop = SkIntToScalar(80); - r.fBottom = SkIntToScalar(100); -// SkDebugf("--------- draw bot grad\n"); - canvas->drawRect(r, paint); -} - -class RedFilter : public SkDrawFilter { -public: - virtual bool filter(SkCanvas*, SkPaint* p, SkDrawFilter::Type) { - fColor = p->getColor(); - if (fColor == SK_ColorRED) { - p->setColor(SK_ColorGREEN); - } - return true; - } - virtual void restore(SkCanvas*, SkPaint* p, SkDrawFilter::Type) { - p->setColor(fColor); - } - -private: - SkColor fColor; -}; - -class LayersView : public SkView { -public: - LayersView() {} - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Layers"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - if (false) { - SkRect r; - r.set(SkIntToScalar(0), SkIntToScalar(0), - SkIntToScalar(220), SkIntToScalar(120)); - SkPaint p; - p.setAlpha(0x88); - p.setAntiAlias(true); - - if (true) { - canvas->saveLayer(&r, &p); - p.setColor(0xFFFF0000); - canvas->drawOval(r, p); - canvas->restore(); - } - - p.setColor(0xFF0000FF); - r.offset(SkIntToScalar(20), SkIntToScalar(50)); - canvas->drawOval(r, p); - } - - if (false) { - SkPaint p; - p.setAlpha(0x88); - p.setAntiAlias(true); - - canvas->translate(SkIntToScalar(300), 0); - - SkRect r; - r.set(SkIntToScalar(0), SkIntToScalar(0), - SkIntToScalar(220), SkIntToScalar(60)); - - canvas->saveLayer(&r, &p, (SkCanvas::SaveFlags)(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag)); -// canvas->clipRect(r, SkRegion::kDifference_Op); -// canvas->clipRect(r, SkRegion::kIntersect_Op); - - r.set(SkIntToScalar(0), SkIntToScalar(0), - SkIntToScalar(220), SkIntToScalar(120)); - p.setColor(SK_ColorBLUE); - canvas->drawOval(r, p); - canvas->restore(); - return; - } - - //canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); - test_fade(canvas); - return; - - // canvas->setDrawFilter(new RedFilter)->unref(); - - SkRect r; - SkPaint p; - - canvas->translate(SkIntToScalar(220), SkIntToScalar(20)); - - p.setAntiAlias(true); - r.set(SkIntToScalar(20), SkIntToScalar(20), - SkIntToScalar(220), SkIntToScalar(120)); - - p.setColor(SK_ColorBLUE); - // p.setMaskFilter(SkBlurMaskFilter::Create(SkIntToScalar(8), SkBlurMaskFilter::kNormal_BlurStyle))->unref(); - canvas->drawRect(r, p); - p.setMaskFilter(NULL); - - SkRect bounds = r; - bounds.fBottom = bounds.centerY(); - canvas->saveLayer(&bounds, NULL, SkCanvas::kARGB_NoClipLayer_SaveFlag); - - p.setColor(SK_ColorRED); - canvas->drawOval(r, p); - - p.setAlpha(0x80); - p.setPorterDuffXfermode(SkPorterDuff::kDstIn_Mode); - canvas->drawRect(bounds, p); - - canvas->restore(); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - this->inval(NULL); - - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - - virtual bool handleKey(SkKey key) { - this->inval(NULL); - return true; - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new LayersView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleLines.cpp b/samplecode/SampleLines.cpp deleted file mode 100644 index a0238b0..0000000 --- a/samplecode/SampleLines.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "Sk64.h" -#include "SkCornerPathEffect.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkKernel33MaskFilter.h" -#include "SkPath.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkXfermode.h" - -#include "SkStream.h" -#include "SkXMLParser.h" -#include "SkColorPriv.h" -#include "SkImageDecoder.h" - -class LinesView : public SkView { -public: - LinesView() - { - unsigned r = 0x1F; - unsigned g = 0x3F; - for (unsigned a = 0; a <= 0xF; a++) { - unsigned scale = 16 - SkAlpha15To16(a); - unsigned sr = (a << 1) | (a >> 3); - unsigned dr = r * scale >> 4; - unsigned sg = (a << 2) | (a >> 2); - unsigned dg = g * scale >> 4; - - unsigned ssg = sg & ~(~(a >> 3) & 1); - - printf("4444 sa=%d sr=%d sg=%d da=%d dr=%d dg=%d total-r=%d total-g=%d %d\n", - a, sr, sg, scale, dr, dg, sr+dr, sg+dg, ssg+dg); - } - - for (unsigned aa = 0; aa <= 0xFF; aa++) { - unsigned invScale = SkAlpha255To256(255 - aa); - unsigned dst = SkAlphaMul(0xFF, invScale); - printf("8888 sa=%02x dst=%02x sum=%d %s\n", aa, dst, aa+dst, - (aa+dst) > 0xFF ? "OVERFLOW" : ""); - } - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Lines"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(SK_ColorWHITE); - // canvas->drawColor(SK_ColorBLACK); - } - - /* - 0x1F * x + 0x1F * (32 - x) - */ - void drawRings(SkCanvas* canvas) - { - canvas->scale(SkIntToScalar(1)/2, SkIntToScalar(1)/2); - - SkRect r; - SkScalar x = SkIntToScalar(10); - SkScalar y = SkIntToScalar(10); - r.set(x, y, x + SkIntToScalar(100), y + SkIntToScalar(100)); - - SkPaint paint; - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkScalarHalf(SkIntToScalar(3))); - paint.setColor(0xFFFF8800); - paint.setColor(0xFFFFFFFF); - canvas->drawRect(r, paint); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - SkBitmap bm; - SkImageDecoder::DecodeFile("/kill.gif", &bm); - canvas->drawBitmap(bm, 0, 0, NULL); - - this->drawRings(canvas); - return; - - SkPaint paint; - - // fAlpha = 0x80; - paint.setColor(SK_ColorWHITE); - paint.setAlpha(fAlpha & 0xFF); - SkRect r; - - SkScalar x = SkIntToScalar(10); - SkScalar y = SkIntToScalar(10); - r.set(x, y, x + SkIntToScalar(100), y + SkIntToScalar(100)); - canvas->drawRect(r, paint); - return; - - paint.setColor(0xffffff00); // yellow - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(2)); - -// y += SK_Scalar1/2; - - canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), paint); - - paint.setAntiAlias(true); // with anti-aliasing - y += SkIntToScalar(10); - canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), paint); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - fAlpha = SkScalarRound(y); - this->inval(NULL); - return NULL; - } -private: - - int fAlpha; - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new LinesView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleMeasure.cpp b/samplecode/SampleMeasure.cpp deleted file mode 100644 index 70b8812..0000000 --- a/samplecode/SampleMeasure.cpp +++ /dev/null @@ -1,138 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "Sk1DPathEffect.h" -#include "SkCornerPathEffect.h" -#include "SkPathMeasure.h" -#include "SkRandom.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkDither.h" - -// exercise scale/linear/devkern -struct Setting { - SkScalar fScale; - bool fLinearText; - bool fDevKernText; -}; - -static const SkScalar ONE = SkIntToScalar(9999)/10000; - -static const Setting gSettings[] = { - { 0, false, false }, - { 0, false, true }, - { 0, true, false }, - { 0, true, true }, - { ONE, false, false }, - { ONE, false, true }, - { ONE, true, false }, - { ONE, true, true } -}; - -static void doMeasure(SkCanvas* canvas, const SkPaint& paint, const char text[]) -{ - SkScalar dy = paint.getFontMetrics(NULL); - - size_t len = strlen(text); - SkAutoTMalloc<SkScalar> autoWidths(len); - SkScalar* widths = autoWidths.get(); - SkAutoTMalloc<SkRect> autoRects(len); - SkRect* rects = autoRects.get(); - SkRect bounds; - - SkPaint p(paint); - for (int i = 0; i < SK_ARRAY_COUNT(gSettings); i++) { - p.setLinearText(gSettings[i].fLinearText); - p.setDevKernText(gSettings[i].fDevKernText); - SkScalar scale = gSettings[i].fScale; - - int n = p.getTextWidths(text, len, widths, rects); - SkScalar w = p.measureText(text, len, &bounds, scale); - - p.setStyle(SkPaint::kFill_Style); - p.setColor(0x8888FF88); - canvas->drawRect(bounds, p); - p.setColor(0xFF000000); - canvas->drawText(text, len, 0, 0, p); - - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(0); - p.setColor(0xFFFF0000); - SkScalar x = 0; - for (int j = 0; j < n; j++) { - SkRect r = rects[j]; - r.offset(x, 0); - canvas->drawRect(r, p); - x += widths[j]; - } - - p.setColor(0xFF0000FF); - canvas->drawLine(0, 0, w, 0, p); - p.setStrokeWidth(SkIntToScalar(4)); - canvas->drawPoint(x, 0, p); - - canvas->translate(0, dy); - } -} - -class MeasureView : public SkView { -public: - SkPaint fPaint; - - MeasureView() - { - fPaint.setAntiAlias(true); - fPaint.setTextSize(SkIntToScalar(64)); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Measure"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - canvas->translate(fPaint.getTextSize(), fPaint.getTextSize()); - doMeasure(canvas, fPaint, "Hamburgefons"); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - // fSweep += SK_Scalar1; - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new MeasureView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleNinePatch.cpp b/samplecode/SampleNinePatch.cpp deleted file mode 100644 index 2fd60a2..0000000 --- a/samplecode/SampleNinePatch.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkImageDecoder.h" -#include "SkNinePatch.h" -#include "SkPaint.h" -#include "SkUnPreMultiply.h" - -class NinePatchView : public SkView { -public: - SkBitmap fBM; - - NinePatchView() { - SkImageDecoder::DecodeFile("/skimages/folder_background.9.png", &fBM); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "NinePatch"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - - canvas->drawBitmap(fBM, 0, 0); - - SkIRect margins; - SkRect dst; - int d = 25; - - margins.set(d, d, d, d); - dst.set(0, 0, SkIntToScalar(200), SkIntToScalar(200)); - dst.offset(SkIntToScalar(fBM.width()), 0); - dst.offset(SkIntToScalar(2), SkIntToScalar(2)); - - SkNinePatch::DrawNine(canvas, dst, fBM, margins); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new NinePatchView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleOverflow.cpp b/samplecode/SampleOverflow.cpp deleted file mode 100644 index 229683f..0000000 --- a/samplecode/SampleOverflow.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkDevice.h" -#include "SkPaint.h" - -static void DrawRoundRect() { -#ifdef SK_SCALAR_IS_FIXED - bool ret = false; - SkPaint paint; - SkBitmap bitmap; - SkCanvas canvas; - SkMatrix matrix; - matrix.reset(); - - bitmap.setConfig(SkBitmap::kARGB_8888_Config, 1370, 812); - bitmap.allocPixels(); - canvas.setBitmapDevice(bitmap); - - // set up clipper - SkRect skclip; - skclip.set(SkIntToFixed(284), SkIntToFixed(40), SkIntToFixed(1370), SkIntToFixed(708)); - - ret = canvas.clipRect(skclip); - SkASSERT(ret); - - matrix.set(SkMatrix::kMTransX, SkFloatToFixed(-1153.28)); - matrix.set(SkMatrix::kMTransY, SkFloatToFixed(1180.50)); - - matrix.set(SkMatrix::kMScaleX, SkFloatToFixed(0.177171)); - matrix.set(SkMatrix::kMScaleY, SkFloatToFixed(0.177043)); - - matrix.set(SkMatrix::kMSkewX, SkFloatToFixed(0.126968)); - matrix.set(SkMatrix::kMSkewY, SkFloatToFixed(-0.126876)); - - matrix.set(SkMatrix::kMPersp0, SkFloatToFixed(0.0)); - matrix.set(SkMatrix::kMPersp1, SkFloatToFixed(0.0)); - - ret = canvas.concat(matrix); - - paint.setAntiAlias(true); - paint.setColor(0xb2202020); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkFloatToFixed(68.13)); - - SkRect r; - r.set(SkFloatToFixed(-313.714417), SkFloatToFixed(-4.826389), SkFloatToFixed(18014.447266), SkFloatToFixed(1858.154541)); - canvas.drawRoundRect(r, SkFloatToFixed(91.756363), SkFloatToFixed(91.756363), paint); -#endif -} - -static bool HitTestPath(const SkPath& path, SkScalar x, SkScalar y) { - SkRegion rgn, clip; - - int ix = SkScalarFloor(x); - int iy = SkScalarFloor(y); - - clip.setRect(ix, iy, ix + 1, iy + 1); - - bool contains = rgn.setPath(path, clip); - return contains; -} - -static void TestOverflowHitTest() { - SkPath path; - -#ifdef SK_SCALAR_IS_FLOATx - path.addCircle(0, 0, 70000, SkPath::kCCW_Direction); - SkASSERT(HitTestPath(path, 40000, 40000)); -#endif -} - -class OverflowView : public SkView { -public: - OverflowView() {} - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Circles"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - DrawRoundRect(); - TestOverflowHitTest(); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new OverflowView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SamplePageFlip.cpp b/samplecode/SamplePageFlip.cpp deleted file mode 100644 index 6b1adfd..0000000 --- a/samplecode/SamplePageFlip.cpp +++ /dev/null @@ -1,173 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGraphics.h" -#include "SkRandom.h" -#include "SkFlipPixelRef.h" -#include "SkPageFlipper.h" - -#include <pthread.h> - -#define WIDTH 200 -#define HEIGHT 200 - -static bool gDone; - -static void bounce(SkScalar* x, SkScalar* dx, const int max) { - *x += *dx; - if (*x < 0) { - *x = 0; - if (*dx < 0) { - *dx = -*dx; - } - } else if (*x > SkIntToScalar(max)) { - *x = SkIntToScalar(max); - if (*dx > 0) { - *dx = -*dx; - } - } -} - -static void* draw_proc(void* context) { - const int OVALW = 32; - const int OVALH = 32; - - const SkBitmap* bm = static_cast<const SkBitmap*>(context); - SkFlipPixelRef* ref = static_cast<SkFlipPixelRef*>(bm->pixelRef()); - - const int DSCALE = 1; - SkScalar dx = SkIntToScalar(7) / DSCALE; - SkScalar dy = SkIntToScalar(5) / DSCALE; - SkScalar x = 0; - SkScalar y = 0; - - SkPaint paint; - - paint.setAntiAlias(true); - paint.setColor(reinterpret_cast<SkColor>(ref) | (0xFF << 24)); - - SkRect oval; - oval.setEmpty(); - - while (!gDone) { - ref->inval(oval, true); - oval.set(x, y, x + SkIntToScalar(OVALW), y + SkIntToScalar(OVALH)); - ref->inval(oval, true); - - SkAutoFlipUpdate update(ref); - - if (!update.dirty().isEmpty()) { - // this must be local to the loop, since it needs to forget the pixels - // its writing to after each iteration, since we do the swap - SkCanvas canvas(update.bitmap()); - -// SkDebugf("----- dirty [%d %d %d %d]\n", dirty.getBounds().fLeft, dirty.getBounds().fTop, dirty.getBounds().width(), dirty.getBounds().height()); - canvas.clipRegion(update.dirty()); - - canvas.drawColor(0, SkPorterDuff::kClear_Mode); - canvas.drawOval(oval, paint); - } - bounce(&x, &dx, WIDTH-OVALW); - bounce(&y, &dy, HEIGHT-OVALH); - -#if 1 - for (int i = 0; i < 1000; i++) { - for (int j = 0; j < 10000; j++) { - SkFixedMul(j, 10); - } - } -#endif - } - return NULL; -} - -static const SkBitmap::Config gConfigs[] = { - SkBitmap::kARGB_8888_Config, -#if 1 - SkBitmap::kRGB_565_Config, - SkBitmap::kARGB_4444_Config, - SkBitmap::kA8_Config -#endif -}; - -class PageFlipView : public SkView { -public: - - enum { N = SK_ARRAY_COUNT(gConfigs) }; - - pthread_t fThreads[N]; - SkBitmap fBitmaps[N]; - - PageFlipView() { - gDone = false; - for (int i = 0; i < N; i++) { - int status; - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - SkASSERT(0 == status); - - fBitmaps[i].setConfig(gConfigs[i], WIDTH, HEIGHT); - SkFlipPixelRef* pr = new SkFlipPixelRef(gConfigs[i], WIDTH, HEIGHT); - fBitmaps[i].setPixelRef(pr)->unref(); - fBitmaps[i].eraseColor(0); - - status = pthread_create(&fThreads[i], &attr, draw_proc, &fBitmaps[i]); - SkASSERT(0 == status); - } - } - - virtual ~PageFlipView() { - gDone = true; - for (int i = 0; i < N; i++) { - void* ret; - int status = pthread_join(fThreads[i], &ret); - SkASSERT(0 == status); - } - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "PageFlip"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); -// canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkScalar x = SkIntToScalar(10); - SkScalar y = SkIntToScalar(10); - for (int i = 0; i < N; i++) { - canvas->drawBitmap(fBitmaps[i], x, y); - x += SkIntToScalar(fBitmaps[i].width() + 20); - } - this->inval(NULL); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new PageFlipView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SamplePatch.cpp b/samplecode/SamplePatch.cpp deleted file mode 100644 index 77bd332..0000000 --- a/samplecode/SamplePatch.cpp +++ /dev/null @@ -1,417 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" - -#include "SkImageRef.h" -#include "SkOSFile.h" -#include "SkStream.h" - -#include "SkGeometry.h" // private include :( - -static void drawtriangle(SkCanvas* canvas, const SkPaint& paint, - const SkPoint pts[3]) { - SkPath path; - - path.moveTo(pts[0]); - path.lineTo(pts[1]); - path.lineTo(pts[2]); - - canvas->drawPath(path, paint); -} - -static SkShader* make_shader0(SkIPoint* size) { - SkBitmap bm; - -// SkImageDecoder::DecodeFile("/skimages/progressivejpg.jpg", &bm); - SkImageDecoder::DecodeFile("/skimages/beach.jpg", &bm); - size->set(bm.width(), bm.height()); - return SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode, - SkShader::kClamp_TileMode); -} - -static SkShader* make_shader1(const SkIPoint& size) { - SkPoint pts[] = { 0, 0, SkIntToScalar(size.fX), SkIntToScalar(size.fY) }; - SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED }; - return SkGradientShader::CreateLinear(pts, colors, NULL, - SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode, NULL); -} - -/////////////////////////////////////////////////////////////////////////////// - -class Patch { -public: - Patch() { bzero(fPts, sizeof(fPts)); } - ~Patch() {} - - void setPatch(const SkPoint pts[12]) { - memcpy(fPts, pts, 12 * sizeof(SkPoint)); - fPts[12] = pts[0]; // the last shall be first - } - void setBounds(int w, int h) { fW = w; fH = h; } - - void draw(SkCanvas*, const SkPaint&, int segsU, int segsV, - bool doTextures, bool doColors); - -private: - SkPoint fPts[13]; - int fW, fH; -}; - -static void eval_patch_edge(const SkPoint cubic[], SkPoint samples[], int segs) { - SkScalar t = 0; - SkScalar dt = SK_Scalar1 / segs; - - samples[0] = cubic[0]; - for (int i = 1; i < segs; i++) { - t += dt; - SkEvalCubicAt(cubic, t, &samples[i], NULL, NULL); - } -} - -static void eval_sheet(const SkPoint edge[], int nu, int nv, int iu, int iv, - SkPoint* pt) { - const int TL = 0; - const int TR = nu; - const int BR = TR + nv; - const int BL = BR + nu; - - SkScalar u = SkIntToScalar(iu) / nu; - SkScalar v = SkIntToScalar(iv) / nv; - - SkScalar uv = SkScalarMul(u, v); - SkScalar Uv = SkScalarMul(SK_Scalar1 - u, v); - SkScalar uV = SkScalarMul(u, SK_Scalar1 - v); - SkScalar UV = SkScalarMul(SK_Scalar1 - u, SK_Scalar1 - v); - - SkScalar x0 = SkScalarMul(UV, edge[TL].fX) + SkScalarMul(uV, edge[TR].fX) + - SkScalarMul(Uv, edge[BL].fX) + SkScalarMul(uv, edge[BR].fX); - SkScalar y0 = SkScalarMul(UV, edge[TL].fY) + SkScalarMul(uV, edge[TR].fY) + - SkScalarMul(Uv, edge[BL].fY) + SkScalarMul(uv, edge[BR].fY); - - SkScalar x = SkScalarMul(SK_Scalar1 - v, edge[TL+iu].fX) + - SkScalarMul(u, edge[TR+iv].fX) + - SkScalarMul(v, edge[BR+nu-iu].fX) + - SkScalarMul(SK_Scalar1 - u, edge[BL+nv-iv].fX) - x0; - SkScalar y = SkScalarMul(SK_Scalar1 - v, edge[TL+iu].fY) + - SkScalarMul(u, edge[TR+iv].fY) + - SkScalarMul(v, edge[BR+nu-iu].fY) + - SkScalarMul(SK_Scalar1 - u, edge[BL+nv-iv].fY) - y0; - pt->set(x, y); -} - -static int ScalarTo255(SkScalar v) { - int scale = SkScalarToFixed(v) >> 8; - if (scale < 0) { - scale = 0; - } else if (scale > 255) { - scale = 255; - } - return scale; -} - -static SkColor make_color(SkScalar s, SkScalar t) { - int cs = ScalarTo255(s); - int ct = ScalarTo255(t); - return SkColorSetARGB(0xFF, cs, 0, 0) + SkColorSetARGB(0, 0, ct, 0); -} - -void Patch::draw(SkCanvas* canvas, const SkPaint& paint, int nu, int nv, - bool doTextures, bool doColors) { - if (nu < 1 || nv < 1) { - return; - } - - int i, npts = (nu + nv) * 2; - SkAutoSTMalloc<16, SkPoint> storage(npts + 1); - SkPoint* edge0 = storage.get(); - SkPoint* edge1 = edge0 + nu; - SkPoint* edge2 = edge1 + nv; - SkPoint* edge3 = edge2 + nu; - - // evaluate the edge points - eval_patch_edge(fPts + 0, edge0, nu); - eval_patch_edge(fPts + 3, edge1, nv); - eval_patch_edge(fPts + 6, edge2, nu); - eval_patch_edge(fPts + 9, edge3, nv); - edge3[nv] = edge0[0]; // the last shall be first - - for (i = 0; i < npts; i++) { -// canvas->drawLine(edge0[i].fX, edge0[i].fY, edge0[i+1].fX, edge0[i+1].fY, paint); - } - - int row, vertCount = (nu + 1) * (nv + 1); - SkAutoTMalloc<SkPoint> vertStorage(vertCount); - SkPoint* verts = vertStorage.get(); - - // first row - memcpy(verts, edge0, (nu + 1) * sizeof(SkPoint)); - // rows - SkPoint* r = verts; - for (row = 1; row < nv; row++) { - r += nu + 1; - r[0] = edge3[nv - row]; - for (int col = 1; col < nu; col++) { - eval_sheet(edge0, nu, nv, col, row, &r[col]); - } - r[nu] = edge1[row]; - } - // last row - SkPoint* last = verts + nv * (nu + 1); - for (i = 0; i <= nu; i++) { - last[i] = edge2[nu - i]; - } - -// canvas->drawPoints(verts, vertCount, paint); - - int stripCount = (nu + 1) * 2; - SkAutoTMalloc<SkPoint> stripStorage(stripCount * 2); - SkAutoTMalloc<SkColor> colorStorage(stripCount); - SkPoint* strip = stripStorage.get(); - SkPoint* tex = strip + stripCount; - SkColor* colors = colorStorage.get(); - SkScalar t = 0; - const SkScalar ds = SK_Scalar1 * fW / nu; - const SkScalar dt = SK_Scalar1 * fH / nv; - r = verts; - for (row = 0; row < nv; row++) { - SkPoint* upper = r; - SkPoint* lower = r + nu + 1; - r = lower; - SkScalar s = 0; - for (i = 0; i <= nu; i++) { - strip[i*2 + 0] = *upper++; - strip[i*2 + 1] = *lower++; - tex[i*2 + 0].set(s, t); - tex[i*2 + 1].set(s, t + dt); - colors[i*2 + 0] = make_color(s/fW, t/fH); - colors[i*2 + 1] = make_color(s/fW, (t + dt)/fH); - s += ds; - } - t += dt; - canvas->drawVertices(SkCanvas::kTriangleStrip_VertexMode, stripCount, - strip, doTextures ? tex : NULL, - doColors ? colors : NULL, NULL, - NULL, 0, paint); - } -} - -static void drawpatches(SkCanvas* canvas, const SkPaint& paint, int nu, int nv, - Patch* patch) { - - SkAutoCanvasRestore ar(canvas, true); - - patch->draw(canvas, paint, 10, 10, false, false); - canvas->translate(SkIntToScalar(300), 0); - patch->draw(canvas, paint, 10, 10, true, false); - canvas->translate(SkIntToScalar(300), 0); - patch->draw(canvas, paint, 10, 10, false, true); - canvas->translate(SkIntToScalar(300), 0); - patch->draw(canvas, paint, 10, 10, true, true); -} - -class PatchView : public SkView { - SkShader* fShader0; - SkShader* fShader1; - SkIPoint fSize0, fSize1; - SkPoint fPts[12]; - -public: - PatchView() { - fShader0 = make_shader0(&fSize0); - fSize1 = fSize0; - if (fSize0.fX == 0 || fSize0.fY == 0) { - fSize1.set(2, 2); - } - fShader1 = make_shader1(fSize1); - - const SkScalar S = SkIntToScalar(90); - const SkScalar T = SkIntToScalar(64); - fPts[0].set(S*1, T); - fPts[1].set(S*2, T); - fPts[2].set(S*3, T); - fPts[3].set(S*4, T); - fPts[4].set(S*4, T*2); - fPts[5].set(S*4, T*3); - fPts[6].set(S*4, T*4); - fPts[7].set(S*3, T*4); - fPts[8].set(S*2, T*4); - fPts[9].set(S*1, T*4); - fPts[10].set(S*1, T*3); - fPts[11].set(S*1, T*2); - } - - virtual ~PatchView() { - fShader0->safeUnref(); - fShader1->safeUnref(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) - { - SkString str("Patch"); - SampleCode::TitleR(evt, str.c_str()); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorGRAY); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkPaint paint; - paint.setDither(true); - paint.setFilterBitmap(true); - - if (false) { - SkPath p; - p.moveTo(0, 0); - p.lineTo(SkIntToScalar(30000), SkIntToScalar(30000)); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(4)); - paint.setAntiAlias(true); - canvas->scale(SkIntToScalar(3), SkIntToScalar(3)); - canvas->drawPath(p, paint); - return; - } - - if (false) { - for (int dy = -1; dy <= 2; dy++) { - canvas->save(); - if (dy == 2) { - canvas->translate(0, SK_Scalar1/2); - } else { - canvas->translate(0, SkIntToScalar(dy)/100); - } - - SkBitmap bm; - bm.setConfig(SkBitmap::kARGB_8888_Config, 20, 20); - bm.allocPixels(); - SkCanvas c(bm); - SkRect r = { 0, 0, 20*SK_Scalar1, SK_Scalar1 }; - for (int y = 0; y < 20; y++) { - SkPaint p; - p.setARGB(0xFF, y*5&0xFF, y*13&0xFF, y*29&0xFF); - c.drawRect(r, p); - r.offset(0, SK_Scalar1); - } - SkIRect src; - SkRect dst; - - static const int srcPts[] = { - // 2, 0, 15, 2, - 2, 2, 15, 16, - 17, 2, 2, 16, - 19, 2, 1, 16, - // 2, 18, 15, 2 - }; - static const double dstPts[] = { - // 7, 262 15, 24.5, - 7, 286.5, 15, 16, - 22, 286.5, 5, 16, - 27, 286.5, 1, 16, - // 7, 302.5, 15, 24.5 - }; - - SkPaint p; -// p.setFilterBitmap(true); - const int* s = srcPts; - const double* d = dstPts; - for (int i = 0; i < 3; i++) { - src.set(s[0], s[1], s[0]+s[2], s[1]+s[3]); - dst.set(SkDoubleToScalar(d[0]), - SkDoubleToScalar(d[1]), - SkDoubleToScalar(d[0]+d[2]), - SkDoubleToScalar(d[1]+d[3])); - canvas->drawBitmapRect(bm, &src, dst, &p); - canvas->translate(SkDoubleToScalar(1), 0); - s += 4; - d += 4; - } - canvas->restore(); - canvas->translate(SkIntToScalar(32), 0); - } - return; - } - - Patch patch; - - paint.setShader(fShader0); - if (fSize0.fX == 0) { - fSize0.fX = 1; - } - if (fSize0.fY == 0) { - fSize0.fY = 1; - } - patch.setBounds(fSize0.fX, fSize0.fY); - - patch.setPatch(fPts); - drawpatches(canvas, paint, 10, 10, &patch); - - paint.setShader(NULL); - paint.setAntiAlias(true); - paint.setStrokeWidth(SkIntToScalar(5)); - canvas->drawPoints(SkCanvas::kPoints_PointMode, SK_ARRAY_COUNT(fPts), - fPts, paint); - - canvas->translate(0, SkIntToScalar(300)); - - paint.setAntiAlias(false); - paint.setShader(fShader1); - patch.setBounds(fSize1.fX, fSize1.fY); - drawpatches(canvas, paint, 10, 10, &patch); - } - - class PtClick : public Click { - public: - int fIndex; - PtClick(SkView* view, int index) : Click(view), fIndex(index) {} - }; - - static bool hittest(const SkPoint& pt, SkScalar x, SkScalar y) { - return SkPoint::Length(pt.fX - x, pt.fY - y) < SkIntToScalar(5); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - for (int i = 0; i < SK_ARRAY_COUNT(fPts); i++) { - if (hittest(fPts[i], x, y)) { - return new PtClick(this, i); - } - } - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - fPts[((PtClick*)click)->fIndex].set(click->fCurr.fX, click->fCurr.fY); - this->inval(NULL); - return true; - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new PatchView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp deleted file mode 100644 index 98f1a5b..0000000 --- a/samplecode/SamplePath.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" - -class PathView : public SkView { -public: - int fDStroke, fStroke, fMinStroke, fMaxStroke; - SkPath fPath[6]; - bool fShowHairline; - - PathView() - { - fShowHairline = false; - - fDStroke = 1; - fStroke = 10; - fMinStroke = 10; - fMaxStroke = 180; - - const int V = 85; - - fPath[0].moveTo(SkIntToScalar(40), SkIntToScalar(70)); - fPath[0].lineTo(SkIntToScalar(70), SkIntToScalar(70) + SK_Scalar1/1); - fPath[0].lineTo(SkIntToScalar(110), SkIntToScalar(70)); - - fPath[1].moveTo(SkIntToScalar(40), SkIntToScalar(70)); - fPath[1].lineTo(SkIntToScalar(70), SkIntToScalar(70) - SK_Scalar1/1); - fPath[1].lineTo(SkIntToScalar(110), SkIntToScalar(70)); - - fPath[2].moveTo(SkIntToScalar(V), SkIntToScalar(V)); - fPath[2].lineTo(SkIntToScalar(50), SkIntToScalar(V)); - fPath[2].lineTo(SkIntToScalar(50), SkIntToScalar(50)); - - fPath[3].moveTo(SkIntToScalar(50), SkIntToScalar(50)); - fPath[3].lineTo(SkIntToScalar(50), SkIntToScalar(V)); - fPath[3].lineTo(SkIntToScalar(V), SkIntToScalar(V)); - - fPath[4].moveTo(SkIntToScalar(50), SkIntToScalar(50)); - fPath[4].lineTo(SkIntToScalar(50), SkIntToScalar(V)); - fPath[4].lineTo(SkIntToScalar(52), SkIntToScalar(50)); - - fPath[5].moveTo(SkIntToScalar(52), SkIntToScalar(50)); - fPath[5].lineTo(SkIntToScalar(50), SkIntToScalar(V)); - fPath[5].lineTo(SkIntToScalar(50), SkIntToScalar(50)); - } - - virtual ~PathView() - { - } - - void nextStroke() - { - fStroke += fDStroke; - if (fStroke > fMaxStroke || fStroke < fMinStroke) - fDStroke = -fDStroke; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Paths"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); -// canvas->drawColor(SK_ColorWHITE); - } - - void drawPath(SkCanvas* canvas, const SkPath& path, SkPaint::Join j) - { - SkPaint paint; - - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeJoin(j); - paint.setStrokeWidth(SkIntToScalar(fStroke)); - - if (fShowHairline) - { - SkPath fill; - - paint.getFillPath(path, &fill); - paint.setStrokeWidth(0); - canvas->drawPath(fill, paint); - } - else - canvas->drawPath(path, paint); - - paint.setColor(SK_ColorRED); - paint.setStrokeWidth(0); - canvas->drawPath(path, paint); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - canvas->translate(SkIntToScalar(50), SkIntToScalar(50)); - - static const SkPaint::Join gJoins[] = { - SkPaint::kBevel_Join, - SkPaint::kMiter_Join, - SkPaint::kRound_Join - }; - - for (int i = 0; i < SK_ARRAY_COUNT(gJoins); i++) - { - canvas->save(); - for (int j = 0; j < SK_ARRAY_COUNT(fPath); j++) - { - this->drawPath(canvas, fPath[j], gJoins[i]); - canvas->translate(SkIntToScalar(200), 0); - } - canvas->restore(); - - canvas->translate(0, SkIntToScalar(200)); - } - - this->nextStroke(); - this->inval(NULL); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - fShowHairline = !fShowHairline; - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new PathView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp deleted file mode 100644 index 4e964d7..0000000 --- a/samplecode/SamplePathEffects.cpp +++ /dev/null @@ -1,282 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "Sk1DPathEffect.h" -#include "SkCornerPathEffect.h" -#include "SkPathMeasure.h" -#include "SkRandom.h" -#include "SkColorPriv.h" -#include "SkPixelXorXfermode.h" - -static void test_grow(SkPath* path) -{ - for (int i = 0; i < 100000; i++) - { - path->lineTo(i, i); - path->lineTo(i, i*2); - } -} - -#define CORNER_RADIUS 12 -static SkScalar gPhase; - -static const int gXY[] = { - 4, 0, 0, -4, 8, -4, 12, 0, 8, 4, 0, 4 -}; - -static SkPathEffect* make_pe(int flags) -{ - if (flags == 1) - return new SkCornerPathEffect(SkIntToScalar(CORNER_RADIUS)); - - SkPath path; - path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1])); - for (unsigned i = 2; i < SK_ARRAY_COUNT(gXY); i += 2) - path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1])); - path.close(); - path.offset(SkIntToScalar(-6), 0); - - SkPathEffect* outer = new SkPath1DPathEffect(path, SkIntToScalar(12), gPhase, SkPath1DPathEffect::kRotate_Style); - - if (flags == 2) - return outer; - - SkPathEffect* inner = new SkCornerPathEffect(SkIntToScalar(CORNER_RADIUS)); - - SkPathEffect* pe = new SkComposePathEffect(outer, inner); - outer->unref(); - inner->unref(); - return pe; -} - -static SkPathEffect* make_warp_pe() -{ - SkPath path; - path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1])); - for (unsigned i = 2; i < SK_ARRAY_COUNT(gXY); i += 2) - path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1])); - path.close(); - path.offset(SkIntToScalar(-6), 0); - - SkPathEffect* outer = new SkPath1DPathEffect(path, SkIntToScalar(12), gPhase, SkPath1DPathEffect::kMorph_Style); - SkPathEffect* inner = new SkCornerPathEffect(SkIntToScalar(CORNER_RADIUS)); - - SkPathEffect* pe = new SkComposePathEffect(outer, inner); - outer->unref(); - inner->unref(); - return pe; -} - -/////////////////////////////////////////////////////////// - -#include "SkColorFilter.h" -#include "SkPorterDuff.h" -#include "SkLayerRasterizer.h" - -class testrast : public SkLayerRasterizer { -public: - testrast() - { - SkPaint paint; - paint.setAntiAlias(true); - -#if 0 - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SK_Scalar1*4); - this->addLayer(paint); - - paint.setStrokeWidth(SK_Scalar1*1); - paint.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - this->addLayer(paint); -#else - paint.setAlpha(0x66); - this->addLayer(paint, SkIntToScalar(4), SkIntToScalar(4)); - - paint.setAlpha(0xFF); - this->addLayer(paint); -#endif - } -}; - -class PathEffectView : public SkView { - SkPath fPath; - SkPoint fClickPt; -public: - PathEffectView() - { - SkRandom rand; - int steps = 20; - SkScalar dist = SkIntToScalar(500); - SkScalar x = SkIntToScalar(20); - SkScalar y = SkIntToScalar(50); - - fPath.moveTo(x, y); - for (int i = 0; i < steps; i++) - { - x += dist/steps; - fPath.lineTo(x, y + SkIntToScalar(rand.nextS() % 25)); - } - - fClickPt.set(SkIntToScalar(200), SkIntToScalar(200)); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "PathEffects"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); - -#if 0 - SkPath path; - test_grow(&path); - SkPaint p; - - p.setAntiAlias(true); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1); - canvas->drawPath(path, p); - path.close(); -#endif - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - if (true) - { - canvas->drawColor(SK_ColorWHITE); - - SkPixelXorXfermode mode(SK_ColorWHITE); - SkPaint paint; - - paint.setColor(SK_ColorRED); - paint.setXfermode(&mode); - paint.setStrokeWidth(SkIntToScalar(8)); - - canvas->drawLine(SkIntToScalar(100), SkIntToScalar(100), - SkIntToScalar(200), SkIntToScalar(200), paint); - canvas->drawLine(SkIntToScalar(100), SkIntToScalar(200), - SkIntToScalar(200), SkIntToScalar(100), paint); - // return; - } - - if (false) - { - SkPath path; - SkPoint pts[] = { SkIntToScalar(100), SkIntToScalar(100), - SkIntToScalar(200), SkIntToScalar(100), - SkIntToScalar(100), SkIntToScalar(200) - }; - SkPaint paint; - - pts[2] = fClickPt; - - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(5)); - - path.moveTo(pts[0]); - path.arcTo(pts[1], pts[2], SkIntToScalar(50)); - canvas->drawPath(path, paint); - - paint.setStrokeWidth(0); - paint.setColor(SK_ColorRED); - canvas->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].fY, paint); - canvas->drawLine(pts[1].fX, pts[1].fY, pts[2].fX, pts[2].fY, paint); - return; - } - - gPhase -= SK_Scalar1; - this->inval(nil); - - SkPaint paint; - - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(5)); - canvas->drawPath(fPath, paint); - paint.setStrokeWidth(0); - - paint.setColor(SK_ColorRED); - paint.setPathEffect(make_pe(1))->unref(); - canvas->drawPath(fPath, paint); - - canvas->translate(0, SkIntToScalar(50)); - - paint.setColor(SK_ColorBLUE); - paint.setPathEffect(make_pe(2))->unref(); - canvas->drawPath(fPath, paint); - - canvas->translate(0, SkIntToScalar(50)); - - paint.setARGB(0xFF, 0, 0xBB, 0); - paint.setPathEffect(make_pe(3))->unref(); - canvas->drawPath(fPath, paint); - - canvas->translate(0, SkIntToScalar(50)); - - paint.setARGB(0xFF, 0, 0, 0); - paint.setPathEffect(make_warp_pe())->unref(); - paint.setRasterizer(new testrast)->unref(); - canvas->drawPath(fPath, paint); - - { - SkRect oval; - - oval.set(SkIntToScalar(50), SkIntToScalar(100), - SkIntToScalar(150), SkIntToScalar(150)); - canvas->drawRoundRect(oval, SkIntToScalar(8), SkIntToScalar(8), paint); - } - - { - SkRect bounds; - SkPaint paint; - - paint.setAntiAlias(true); - paint.setAlpha(0x80); - paint.setColorFilter( - SkColorFilter::CreatePorterDuffFilter( - SkColorSetARGB(0x44, 0, 0xFF, 0), SkPorterDuff::kSrcATop_Mode))->unref(); - - bounds.set(SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(150), SkIntToScalar(70)); - canvas->saveLayer(&bounds, &paint, - (SkCanvas::SaveFlags)(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag)); - - paint.setColorFilter(NULL); - paint.setColor(SK_ColorRED); - canvas->drawOval(bounds, paint); - - paint.setColor(SK_ColorBLUE); - paint.setAlpha(0x80); - bounds.inset(SkIntToScalar(10), SkIntToScalar(10)); - canvas->drawOval(bounds, paint); - - canvas->restore(); - } - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new PathEffectView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SamplePicture.cpp b/samplecode/SamplePicture.cpp deleted file mode 100644 index dfc1555..0000000 --- a/samplecode/SamplePicture.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "Sk64.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkKernel33MaskFilter.h" -#include "SkPath.h" -#include "SkPicture.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkXfermode.h" - -#include "SkStream.h" -#include "SkXMLParser.h" - -static void drawCircle(SkCanvas* canvas, int r, SkColor color) { - SkPaint paint; - paint.setAntiAlias(true); - paint.setColor(color); - - canvas->drawCircle(SkIntToScalar(r), SkIntToScalar(r), SkIntToScalar(r), - paint); -} - -class PictureView : public SkView { -public: - PictureView() { - fPicture = new SkPicture; - SkCanvas* canvas = fPicture->beginRecording(100, 100); - SkPaint paint; - paint.setAntiAlias(true); - - drawCircle(canvas, 50, SK_ColorBLACK); - fSubPicture = new SkPicture; - canvas->drawPicture(*fSubPicture); - canvas->translate(SkIntToScalar(50), 0); - canvas->drawPicture(*fSubPicture); - canvas->translate(0, SkIntToScalar(50)); - canvas->drawPicture(*fSubPicture); - canvas->translate(SkIntToScalar(-50), 0); - canvas->drawPicture(*fSubPicture); - // fPicture now has (4) references to us. We can release ours, and just - // unref fPicture in our destructor, and it will in turn take care of - // the other references to fSubPicture - fSubPicture->unref(); - } - - virtual ~PictureView() { - fPicture->unref(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Picture"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(SK_ColorWHITE); - // canvas->drawColor(SK_ColorBLACK); - } - - void drawSomething(SkCanvas* canvas) { - SkPaint paint; - - paint.setAntiAlias(true); - - paint.setColor(SK_ColorRED); - canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50), - SkIntToScalar(40), paint); - paint.setColor(SK_ColorBLACK); - paint.setTextSize(SkIntToScalar(40)); - canvas->drawText("Picture", 7, SkIntToScalar(50), SkIntToScalar(62), - paint); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - drawSomething(canvas); - - SkPicture* pict = new SkPicture; - SkAutoUnref aur(pict); - - drawSomething(pict->beginRecording(100, 100)); - pict->endRecording(); - - canvas->save(); - canvas->translate(SkIntToScalar(300), SkIntToScalar(50)); - canvas->scale(-SK_Scalar1, -SK_Scalar1); - canvas->translate(-SkIntToScalar(100), -SkIntToScalar(50)); - canvas->drawPicture(*pict); - canvas->restore(); - - canvas->save(); - canvas->translate(SkIntToScalar(200), SkIntToScalar(150)); - canvas->scale(SK_Scalar1, -SK_Scalar1); - canvas->translate(0, -SkIntToScalar(50)); - canvas->drawPicture(*pict); - canvas->restore(); - - canvas->save(); - canvas->translate(SkIntToScalar(100), SkIntToScalar(100)); - canvas->scale(-SK_Scalar1, SK_Scalar1); - canvas->translate(-SkIntToScalar(100), 0); - canvas->drawPicture(*pict); - canvas->restore(); - - // test that we can re-record a subpicture, and see the results - - canvas->translate(SkIntToScalar(10), SkIntToScalar(250)); - drawCircle(fSubPicture->beginRecording(50, 50), 25, - fRand.nextU() | 0xFF000000); - canvas->drawPicture(*fPicture); - delayInval(500); - } - -private: - #define INVAL_ALL_TYPE "inval-all" - - void delayInval(SkMSec delay) { - (new SkEvent(INVAL_ALL_TYPE))->post(this->getSinkID(), delay); - } - - virtual bool onEvent(const SkEvent& evt) { - if (evt.isType(INVAL_ALL_TYPE)) { - this->inval(NULL); - return true; - } - return this->INHERITED::onEvent(evt); - } - - SkPicture* fPicture; - SkPicture* fSubPicture; - SkRandom fRand; - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new PictureView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SamplePoints.cpp b/samplecode/SamplePoints.cpp deleted file mode 100644 index 7dc98f3..0000000 --- a/samplecode/SamplePoints.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "Sk64.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkKernel33MaskFilter.h" -#include "SkPath.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkXfermode.h" - -#include "SkStream.h" -#include "SkXMLParser.h" - -static SkRandom gRand; - -static const struct { - const char* fName; - uint32_t fFlags; - bool fFlushCache; -} gHints[] = { - { "Linear", SkPaint::kLinearText_Flag, false }, - { "Normal", 0, true }, - { "Subpixel", SkPaint::kSubpixelText_Flag, true } -}; - -#ifdef SK_DEBUG - #define REPEAT_COUNT 1 -#else - #define REPEAT_COUNT 5000 -#endif - -class PointsView : public SkView { - bool fAA; -public: - PointsView() : fAA(false) {} - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Points"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(SK_ColorWHITE); - // canvas->drawColor(SK_ColorBLACK); - } - - static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) - { - for (size_t i = 0; i < n; i++) - pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - canvas->translate(SK_Scalar1, SK_Scalar1); - - SkRandom rand; - SkPaint p0, p1, p2, p3; - const size_t n = 99; - const int TIMES = 1; - - p0.setColor(SK_ColorRED); - p1.setColor(SK_ColorGREEN); - p2.setColor(SK_ColorBLUE); - p3.setColor(SK_ColorWHITE); - - // fAA = !fAA; - - p0.setAntiAlias(fAA); - p1.setAntiAlias(fAA); - p2.setAntiAlias(fAA); - p3.setAntiAlias(fAA); - - p0.setStrokeWidth(SkIntToScalar(4)); - p2.setStrokeWidth(SkIntToScalar(6)); - - SkPoint* pts = new SkPoint[n]; - fill_pts(pts, n, &rand); - -// SkMSec now = SkTime::GetMSecs(); - for (int times = 0; times < TIMES; times++) - { - canvas->drawPoints(SkCanvas::kPolygon_PointMode, n, pts, p0); - canvas->drawPoints(SkCanvas::kLines_PointMode, n, pts, p1); - canvas->drawPoints(SkCanvas::kPoints_PointMode, n, pts, p2); - canvas->drawPoints(SkCanvas::kPoints_PointMode, n, pts, p3); - } - // printf("----- msecs %d\n", SkTime::GetMSecs() - now); - delete[] pts; - } - -private: - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new PointsView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SamplePolyToPoly.cpp b/samplecode/SamplePolyToPoly.cpp deleted file mode 100644 index 98e4484..0000000 --- a/samplecode/SamplePolyToPoly.cpp +++ /dev/null @@ -1,165 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGraphics.h" -#include "SkPath.h" -#include "SkRandom.h" -#include "SkTime.h" - -extern bool SkSetPoly3To3(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]); - -class PolyToPolyView : public SkView { -public: - PolyToPolyView() { - // tests - { - SkPoint src[] = { 0, 0, SK_Scalar1, 0, 0, SK_Scalar1 }; - SkPoint dst[] = { 0, 0, 2*SK_Scalar1, 0, 0, 2*SK_Scalar1 }; - SkMatrix m1, m2; - bool success; - - success = m1.setPolyToPoly(src, dst, 3); - SkDebugf("--- setPolyToPoly1 %d\n", success); - - m2.reset(); - m2.set(SkMatrix::kMScaleX, dst[1].fX - dst[0].fX); - m2.set(SkMatrix::kMSkewX, dst[2].fX - dst[0].fX); - m2.set(SkMatrix::kMTransX, dst[0].fX); - m2.set(SkMatrix::kMSkewY, dst[1].fY - dst[0].fY); - m2.set(SkMatrix::kMScaleY, dst[2].fY - dst[0].fY); - m2.set(SkMatrix::kMTransY, dst[0].fY); - - m1.reset(); - - const SkScalar src1[] = { - 0, 0, 0, SkFloatToScalar(427), SkFloatToScalar(316), SkFloatToScalar(427), SkFloatToScalar(316), 0 - }; - const SkScalar dst1[] = { - SkFloatToScalar(158), SkFloatToScalar(177.5f), SkFloatToScalar(158), SkFloatToScalar(249.5f), - SkFloatToScalar(158), SkFloatToScalar(604.5f), SkFloatToScalar(158), SkFloatToScalar(-177.5f) - }; - - success = m2.setPolyToPoly((const SkPoint*)src1, (SkPoint*)dst1, 4); - SkDebugf("--- setPolyToPoly2 %d\n", success); - - { - const SkPoint src[] = { - SkIntToScalar(1), SkIntToScalar(0), - SkIntToScalar(4), SkIntToScalar(7), - SkIntToScalar(10), SkIntToScalar(2) - }; - const SkPoint dst[] = { - SkIntToScalar(4), SkIntToScalar(2), - SkIntToScalar(45), SkIntToScalar(26), - SkIntToScalar(32), SkIntToScalar(17) - }; - - SkMatrix m0, m1; - m0.setPolyToPoly(src, dst, 3); - SkSetPoly3To3(&m1, src, dst); - m0.dump(); - m1.dump(); - } - } - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SkString str("PolyToPolyView"); - SampleCode::TitleR(evt, str.c_str()); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - } - - static void doDraw(SkCanvas* canvas, SkPaint* paint, const int isrc[], - const int idst[], int count) { - SkMatrix matrix; - SkPoint src[4], dst[4]; - - for (int i = 0; i < count; i++) { - src[i].set(SkIntToScalar(isrc[2*i+0]), SkIntToScalar(isrc[2*i+1])); - dst[i].set(SkIntToScalar(idst[2*i+0]), SkIntToScalar(idst[2*i+1])); - } - - canvas->save(); - matrix.setPolyToPoly(src, dst, count); - canvas->concat(matrix); - - paint->setColor(SK_ColorGRAY); - paint->setStyle(SkPaint::kStroke_Style); - const SkScalar D = SkIntToScalar(64); - canvas->drawRectCoords(0, 0, D, D, *paint); - canvas->drawLine(0, 0, D, D, *paint); - canvas->drawLine(0, D, D, 0, *paint); - - SkPaint::FontMetrics fm; - paint->getFontMetrics(&fm); - paint->setColor(SK_ColorRED); - paint->setStyle(SkPaint::kFill_Style); - SkScalar x = D/2; - float y = D/2 - (fm.fAscent + fm.fDescent)/2; - SkString str; - str.appendS32(count); - canvas->drawText(str.c_str(), str.size(), x, y, *paint); - - canvas->restore(); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkPaint paint; - paint.setAntiAlias(true); - paint.setStrokeWidth(SkIntToScalar(4)); - paint.setTextSize(SkIntToScalar(40)); - paint.setTextAlign(SkPaint::kCenter_Align); - - canvas->save(); - canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); - // translate (1 point) - const int src1[] = { 0, 0 }; - const int dst1[] = { 5, 5 }; - doDraw(canvas, &paint, src1, dst1, 1); - canvas->restore(); - - canvas->save(); - canvas->translate(SkIntToScalar(160), SkIntToScalar(10)); - // rotate/uniform-scale (2 points) - const int src2[] = { 32, 32, 64, 32 }; - const int dst2[] = { 32, 32, 64, 48 }; - doDraw(canvas, &paint, src2, dst2, 2); - canvas->restore(); - - canvas->save(); - canvas->translate(SkIntToScalar(10), SkIntToScalar(110)); - // rotate/skew (3 points) - const int src3[] = { 0, 0, 64, 0, 0, 64 }; - const int dst3[] = { 0, 0, 96, 0, 24, 64 }; - doDraw(canvas, &paint, src3, dst3, 3); - canvas->restore(); - - canvas->save(); - canvas->translate(SkIntToScalar(160), SkIntToScalar(110)); - // perspective (4 points) - const int src4[] = { 0, 0, 64, 0, 64, 64, 0, 64 }; - const int dst4[] = { 0, 0, 96, 0, 64, 96, 0, 64 }; - doDraw(canvas, &paint, src4, dst4, 4); - canvas->restore(); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new PolyToPolyView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleRegion.cpp b/samplecode/SampleRegion.cpp deleted file mode 100644 index fd20a81..0000000 --- a/samplecode/SampleRegion.cpp +++ /dev/null @@ -1,325 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkImageDecoder.h" - -#ifdef SK_DEBUG -static void make_rgn(SkRegion* rgn, int left, int top, int right, int bottom, - size_t count, int32_t runs[]) { - SkIRect r; - r.set(left, top, right, bottom); - - rgn->debugSetRuns(runs, count); - SkASSERT(rgn->getBounds() == r); -} - -static void test_union_bug_1505668(SkRegion* ra, SkRegion* rb, SkRegion* rc) { - static int32_t dataA[] = { - 0x00000001, 0x000001dd, - 0x00000001, 0x0000000c, 0x0000000d, 0x00000025, - 0x7fffffff, 0x000001de, 0x00000001, 0x00000025, - 0x7fffffff, 0x000004b3, 0x00000001, 0x00000026, - 0x7fffffff, 0x000004b4, 0x0000000c, 0x00000026, - 0x7fffffff, 0x00000579, 0x00000000, 0x0000013a, - 0x7fffffff, 0x000005d8, 0x00000000, 0x0000013b, - 0x7fffffff, 0x7fffffff - }; - make_rgn(ra, 0, 1, 315, 1496, SK_ARRAY_COUNT(dataA), dataA); - - static int32_t dataB[] = { - 0x000000b6, 0x000000c4, - 0x000000a1, 0x000000f0, 0x7fffffff, 0x000000d6, - 0x7fffffff, 0x000000e4, 0x00000070, 0x00000079, - 0x000000a1, 0x000000b0, 0x7fffffff, 0x000000e6, - 0x7fffffff, 0x000000f4, 0x00000070, 0x00000079, - 0x000000a1, 0x000000b0, 0x7fffffff, 0x000000f6, - 0x7fffffff, 0x00000104, 0x000000a1, 0x000000b0, - 0x7fffffff, 0x7fffffff - }; - make_rgn(rb, 112, 182, 240, 260, SK_ARRAY_COUNT(dataB), dataB); - - rc->op(*ra, *rb, SkRegion::kUnion_Op); -} -#endif - -static void paint_rgn(SkCanvas* canvas, const SkRegion& rgn, const SkPaint& paint) -{ - SkRegion::Iterator iter(rgn); - - for (; !iter.done(); iter.next()) - { - SkRect r; - r.set(iter.rect()); - canvas->drawRect(r, paint); - } -} - -class RegionView : public SkView { -public: - RegionView() - { - fBase.set(100, 100, 150, 150); - fRect = fBase; - fRect.inset(5, 5); - fRect.offset(25, 25); - } - - void build_rgn(SkRegion* rgn, SkRegion::Op op) - { - rgn->setRect(fBase); - SkIRect r = fBase; - r.offset(75, 20); - rgn->op(r, SkRegion::kUnion_Op); - rgn->op(fRect, op); - } - - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Regions"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawOrig(SkCanvas* canvas, bool bg) - { - SkRect r; - SkPaint paint; - - paint.setStyle(SkPaint::kStroke_Style); - if (bg) - paint.setColor(0xFFBBBBBB); - - r.set(fBase); - canvas->drawRect(r, paint); - r.set(fRect); - canvas->drawRect(r, paint); - } - - void drawRgnOped(SkCanvas* canvas, SkRegion::Op op, SkColor color) - { - SkRegion rgn; - - this->build_rgn(&rgn, op); - - { - SkRegion tmp, tmp2(rgn); - - tmp = tmp2; - tmp.translate(5, -3); - - { - char buffer[1000]; - size_t size = tmp.flatten(NULL); - SkASSERT(size <= sizeof(buffer)); - size_t size2 = tmp.flatten(buffer); - SkASSERT(size == size2); - - SkRegion tmp3; - size2 = tmp3.unflatten(buffer); - SkASSERT(size == size2); - - SkASSERT(tmp3 == tmp); - } - - rgn.translate(20, 30, &tmp); - SkASSERT(rgn.isEmpty() || tmp != rgn); - tmp.translate(-20, -30); - SkASSERT(tmp == rgn); - } - - this->drawOrig(canvas, true); - - SkPaint paint; - paint.setColor((color & ~(0xFF << 24)) | (0x44 << 24)); - paint_rgn(canvas, rgn, paint); - - paint.setStyle(SkPaint::kStroke_Style); - paint.setColor(color); - paint_rgn(canvas, rgn, paint); - } - - void drawPathOped(SkCanvas* canvas, SkRegion::Op op, SkColor color) - { - SkRegion rgn; - SkPath path; - - this->build_rgn(&rgn, op); - rgn.getBoundaryPath(&path); - - this->drawOrig(canvas, true); - - SkPaint paint; - - paint.setStyle(SkPaint::kFill_Style); - paint.setColor((color & ~(0xFF << 24)) | (0x44 << 24)); - canvas->drawPath(path, paint); - paint.setColor(color); - paint.setStyle(SkPaint::kStroke_Style); - canvas->drawPath(path, paint); - } - - void drawBG(SkCanvas* canvas) - { - canvas->drawColor(0xFFDDDDDD); - return; - -#if 0 - SkColorTable ct; - SkPMColor colors[] = { SK_ColorRED, SK_ColorBLUE }; - ct.setColors(colors, 2); - ct.setFlags(ct.getFlags() | SkColorTable::kColorsAreOpaque_Flag); - - SkBitmap bm; - bm.setConfig(SkBitmap::kIndex8_Config, 20, 20, 21); - bm.setColorTable(&ct); - bm.allocPixels(); - sk_memset16((uint16_t*)bm.getAddr8(0, 0), 0x0001, bm.rowBytes() * bm.height() / 2); -#endif -#if 0 - SkBitmap bm; - bm.setConfig(SkBitmap::kRGB_565_Config, 20, 20, 42); - bm.allocPixels(); - sk_memset32((uint32_t*)bm.getAddr16(0, 0), 0x0000FFFF, bm.rowBytes() * bm.height() / 4); -#endif -#if 1 - SkBitmap bm; - bm.setConfig(SkBitmap::kARGB_8888_Config, 20, 20); - bm.allocPixels(); - sk_memset32((uint32_t*)bm.getAddr32(0, 0), 0xFFDDDDDD, bm.rowBytes() * bm.height() / 4); -#endif - - SkPaint paint; - -// SkShader* shader = SkShader::CreateBitmapShader(bm, false, SkPaint::kBilinear_FilterType, SkShader::kRepeat_TileMode); - SkPoint pts[] = { 0, 0, SkIntToScalar(100), SkIntToScalar(0) }; - SkColor colors[] = { SK_ColorBLACK, SK_ColorWHITE }; - SkShader* shader = SkGradientShader::CreateLinear(pts, colors, nil, 2, SkShader::kMirror_TileMode); - paint.setShader(shader)->unref(); - - canvas->drawPaint(paint); - } - - virtual void onDraw(SkCanvas* canvas) - { - if (true) { - SkRect r = { 0, 0, 1 << 30, 1 << 30 }; - bool open = canvas->clipRect(r); - SkDebugf("---- giant clip is %d\n", open); - } - this->drawBG(canvas); - - if (false) { - SkPaint paint; - paint.setAntiAlias(true); - SkBitmap bm; - bm.setConfig(SkBitmap::kA8_Config, 100, 100); - bm.allocPixels(); - bm.eraseColor(0); - SkCanvas c(bm); - c.drawCircle(50, 50, 50, paint); - - paint.setColor(SK_ColorBLUE); - canvas->drawBitmap(bm, 0, 0, &paint); - canvas->scale(SK_Scalar1/2, SK_Scalar1/2); - paint.setColor(SK_ColorRED); - canvas->drawBitmap(bm, 0, 0, &paint); - return; - } - -#ifdef SK_DEBUG - if (true) { - SkRegion a, b, c; - test_union_bug_1505668(&a, &b, &c); - - if (false) { // draw the result of the test - SkPaint paint; - - canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); - paint.setColor(SK_ColorRED); - paint_rgn(canvas, a, paint); - paint.setColor(0x800000FF); - paint_rgn(canvas, b, paint); - paint.setColor(SK_ColorBLACK); - paint.setStyle(SkPaint::kStroke_Style); - // paint_rgn(canvas, c, paint); - return; - } - } -#endif - - static const struct { - SkColor fColor; - const char* fName; - SkRegion::Op fOp; - } gOps[] = { - { SK_ColorBLACK, "Difference", SkRegion::kDifference_Op }, - { SK_ColorRED, "Intersect", SkRegion::kIntersect_Op }, - { 0xFF008800, "Union", SkRegion::kUnion_Op }, - { SK_ColorBLUE, "XOR", SkRegion::kXOR_Op } - }; - - SkPaint textPaint; - textPaint.setAntiAlias(true); - textPaint.setTextSize(SK_Scalar1*24); - - this->drawOrig(canvas, false); - canvas->save(); - canvas->translate(SkIntToScalar(200), 0); - this->drawRgnOped(canvas, SkRegion::kUnion_Op, SK_ColorBLACK); - canvas->restore(); - - canvas->translate(0, SkIntToScalar(200)); - - for (int op = 0; op < SK_ARRAY_COUNT(gOps); op++) - { - canvas->drawText(gOps[op].fName, strlen(gOps[op].fName), SkIntToScalar(75), SkIntToScalar(50), textPaint); - - this->drawRgnOped(canvas, gOps[op].fOp, gOps[op].fColor); - - if (true) - { - canvas->save(); - canvas->translate(0, SkIntToScalar(200)); - this->drawPathOped(canvas, gOps[op].fOp, gOps[op].fColor); - canvas->restore(); - } - - canvas->translate(SkIntToScalar(200), 0); - } - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - return fRect.contains(SkScalarRound(x), SkScalarRound(y)) ? new Click(this) : nil; - } - - virtual bool onClick(Click* click) - { - fRect.offset(click->fICurr.fX - click->fIPrev.fX, - click->fICurr.fY - click->fIPrev.fY); - this->inval(nil); - return true; - } - -private: - SkIRect fBase, fRect; - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new RegionView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleShaders.cpp b/samplecode/SampleShaders.cpp deleted file mode 100644 index f5ddca9..0000000 --- a/samplecode/SampleShaders.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkComposeShader.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTransparentShader.h" -#include "SkTypeface.h" - -static SkShader* make_bitmapfade(const SkBitmap& bm) -{ - SkPoint pts[2]; - SkColor colors[2]; - - pts[0].set(0, 0); - pts[1].set(0, SkIntToScalar(bm.height())); - colors[0] = SK_ColorBLACK; - colors[1] = SkColorSetARGB(0, 0, 0, 0); - SkShader* shaderA = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode); - - SkShader* shaderB = SkShader::CreateBitmapShader(bm, - SkShader::kClamp_TileMode, SkShader::kClamp_TileMode); - - SkXfermode* mode = SkPorterDuff::CreateXfermode(SkPorterDuff::kDstIn_Mode); - - SkShader* shader = new SkComposeShader(shaderB, shaderA, mode); - shaderA->unref(); - shaderB->unref(); - mode->unref(); - - return shader; -} - -class ShaderView : public SkView { -public: - SkShader* fShader; - SkBitmap fBitmap; - - ShaderView() - { - SkImageDecoder::DecodeFile("/cover.png", &fBitmap); - - SkPoint pts[2]; - SkColor colors[2]; - - pts[0].set(0, 0); - pts[1].set(SkIntToScalar(100), 0); - colors[0] = SK_ColorRED; - colors[1] = SK_ColorBLUE; - SkShader* shaderA = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode); - - pts[0].set(0, 0); - pts[1].set(0, SkIntToScalar(100)); - colors[0] = SK_ColorBLACK; - colors[1] = SkColorSetARGB(0x80, 0, 0, 0); - SkShader* shaderB = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode); - - SkXfermode* mode = SkPorterDuff::CreateXfermode(SkPorterDuff::kDstIn_Mode); - - fShader = new SkComposeShader(shaderA, shaderB, mode); - shaderA->unref(); - shaderB->unref(); - mode->unref(); - } - virtual ~ShaderView() - { - fShader->safeUnref(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Shaders"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - canvas->drawBitmap(fBitmap, 0, 0); - - { - SkIRect src; - SkRect dst; - - src.set(20, 50, 120, 70); - dst.set(src); - dst.offset(SkIntToScalar(300), 0); - - canvas->drawBitmapRect(fBitmap, &src, dst); - } - - canvas->translate(SkIntToScalar(80), SkIntToScalar(80)); - - SkPaint paint; - SkRect r; - - paint.setColor(SK_ColorGREEN); - canvas->drawRectCoords(0, 0, SkIntToScalar(100), SkIntToScalar(100), paint); - paint.setShader(fShader); - canvas->drawRectCoords(0, 0, SkIntToScalar(100), SkIntToScalar(100), paint); - - canvas->translate(SkIntToScalar(110), 0); - - r.set(0, 0, SkIntToScalar(fBitmap.width()), SkIntToScalar(fBitmap.height())); - - paint.setShader(NULL); - canvas->drawRect(r, paint); - paint.setShader(make_bitmapfade(fBitmap))->unref(); - canvas->drawRect(r, paint); - - paint.setShader(new SkTransparentShader)->unref(); - canvas->drawRect(r, paint); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new ShaderView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleStrokeText.cpp b/samplecode/SampleStrokeText.cpp deleted file mode 100644 index 0627d51..0000000 --- a/samplecode/SampleStrokeText.cpp +++ /dev/null @@ -1,147 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "Sk64.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkKernel33MaskFilter.h" -#include "SkPath.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkXfermode.h" - -static void lettersToBitmap(SkBitmap* dst, const char chars[], - const SkPaint& original, SkBitmap::Config config) { - SkPath path; - SkScalar x = 0; - SkScalar width; - SkPath p; - for (int i = 0; i < strlen(chars); i++) { - original.getTextPath(&chars[i], 1, x, 0, &p); - path.addPath(p); - original.getTextWidths(&chars[i], 1, &width); - x += width; - } - SkRect bounds; - path.computeBounds(&bounds, SkPath::kExact_BoundsType); - SkScalar sw = -original.getStrokeWidth(); - bounds.inset(sw, sw); - path.offset(-bounds.fLeft, -bounds.fTop); - bounds.offset(-bounds.fLeft, -bounds.fTop); - - int w = SkScalarRound(bounds.width()); - int h = SkScalarRound(bounds.height()); - SkPaint paint(original); - SkBitmap src; - src.setConfig(config, w, h); - src.allocPixels(); - src.eraseColor(0); - { - SkCanvas canvas(src); - paint.setAntiAlias(true); - paint.setColor(SK_ColorBLACK); - paint.setStyle(SkPaint::kFill_Style); - canvas.drawPath(path, paint); - } - - dst->setConfig(config, w, h); - dst->allocPixels(); - dst->eraseColor(SK_ColorWHITE); - { - SkCanvas canvas(*dst); - paint.setPorterDuffXfermode(SkPorterDuff::kDstATop_Mode); - canvas.drawBitmap(src, 0, 0, &paint); - paint.setColor(original.getColor()); - paint.setStyle(SkPaint::kStroke_Style); - canvas.drawPath(path, paint); - } -} - -static void lettersToBitmap2(SkBitmap* dst, const char chars[], - const SkPaint& original, SkBitmap::Config config) { - SkPath path; - SkScalar x = 0; - SkScalar width; - SkPath p; - for (int i = 0; i < strlen(chars); i++) { - original.getTextPath(&chars[i], 1, x, 0, &p); - path.addPath(p); - original.getTextWidths(&chars[i], 1, &width); - x += width; - } - SkRect bounds; - path.computeBounds(&bounds, SkPath::kExact_BoundsType); - SkScalar sw = -original.getStrokeWidth(); - bounds.inset(sw, sw); - path.offset(-bounds.fLeft, -bounds.fTop); - bounds.offset(-bounds.fLeft, -bounds.fTop); - - int w = SkScalarRound(bounds.width()); - int h = SkScalarRound(bounds.height()); - SkPaint paint(original); - - paint.setAntiAlias(true); - paint.setPorterDuffXfermode(SkPorterDuff::kDstATop_Mode); - paint.setColor(original.getColor()); - paint.setStyle(SkPaint::kStroke_Style); - - dst->setConfig(config, w, h); - dst->allocPixels(); - dst->eraseColor(SK_ColorWHITE); - - SkCanvas canvas(*dst); - canvas.drawPath(path, paint); -} - -class StrokeTextView : public SkView { - bool fAA; -public: - StrokeTextView() : fAA(false) {} - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "StrokeText"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFF333333); - canvas->drawColor(0xFFCC8844); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkBitmap bm; - SkPaint paint; - - paint.setStrokeWidth(SkIntToScalar(6)); - paint.setTextSize(SkIntToScalar(80)); -// paint.setTypeface(Typeface.DEFAULT_BOLD); - - lettersToBitmap(&bm, "Test Case", paint, SkBitmap::kARGB_4444_Config); - - canvas->drawBitmap(bm, 0, 0); - } - -private: - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new StrokeTextView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleTests.cpp b/samplecode/SampleTests.cpp deleted file mode 100644 index d021672..0000000 --- a/samplecode/SampleTests.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkBlurMaskFilter.h" -#include "SkCamera.h" -#include "SkColorFilter.h" -#include "SkColorPriv.h" -#include "SkDevice.h" -#include "SkGradientShader.h" -#include "SkImageDecoder.h" -#include "SkInterpolator.h" -#include "SkMaskFilter.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkShaderExtras.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkUtils.h" -#include "SkKey.h" -#include "SkPorterDuff.h" -#include "SkXfermode.h" -#include "SkDrawFilter.h" - -#include "test.h" - -class TestsView : public SkView { -public: - skia::Test::Iter fIter; - - TestsView() {} - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Tests"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - skia::Test* test = fIter.next(); - if (NULL == test) { - fIter.reset(); - test = fIter.next(); - } - - SkIPoint size; - test->getSize(&size); - - SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.fX, size.fY); - bitmap.allocPixels(); - bitmap.eraseColor(0); - - SkCanvas c(bitmap); - test->draw(&c); - - canvas->drawBitmap(bitmap, SkIntToScalar(10), SkIntToScalar(10), NULL); - - SkString str; - test->getString(skia::Test::kTitle, &str); - SkDebugf("--- %s\n", str.c_str()); - delete test; - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - this->inval(NULL); - - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - this->inval(NULL); - return this->INHERITED::onClick(click); - } - - virtual bool handleKey(SkKey key) { - this->inval(NULL); - return true; - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new TestsView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleText.cpp b/samplecode/SampleText.cpp deleted file mode 100644 index b8abac3..0000000 --- a/samplecode/SampleText.cpp +++ /dev/null @@ -1,793 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "Sk64.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkKernel33MaskFilter.h" -#include "SkPath.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkXfermode.h" - -#include "SkStream.h" -#include "SkXMLParser.h" - -static const int gKernel[3][3] = { -// { -1, -2, -1 }, { -2, 12, -2 }, { -1, -2, -1 } - { 1, 2, 1 }, { 2, 64-12, 2 }, { 1, 2, 1 } -}; -static const int gShift = 6; - -class ReduceNoise : public SkKernel33ProcMaskFilter { -public: - ReduceNoise(int percent256) : SkKernel33ProcMaskFilter(percent256) {} - virtual uint8_t computeValue(uint8_t* const* srcRows) - { - int c = srcRows[1][1]; - int min = 255, max = 0; - for (int i = 0; i < 3; i++) - for (int j = 0; j < 3; j++) - if (i != 1 || j != 1) - { - int v = srcRows[i][j]; - if (max < v) - max = v; - if (min > v) - min = v; - } - if (c > max) c = max; - // if (c < min) c = min; - return c; - } - virtual Factory getFactory() { return Create; } -private: - ReduceNoise(SkFlattenableReadBuffer& rb) : SkKernel33ProcMaskFilter(rb) {} - static SkFlattenable* Create(SkFlattenableReadBuffer& rb) - { - return new ReduceNoise(rb); - } -}; - -class Darken : public SkKernel33ProcMaskFilter { -public: - Darken(int percent256) : SkKernel33ProcMaskFilter(percent256) {} - virtual uint8_t computeValue(uint8_t* const* srcRows) - { - int c = srcRows[1][1]; - float f = c / 255.f; - - if (c >= 0) - { - f = sqrtf(f); - } - else - { - f *= f; - } - SkASSERT(f >= 0 && f <= 1); - return (int)(f * 255); - } - virtual Factory getFactory() { return Create; } -private: - Darken(SkFlattenableReadBuffer& rb) : SkKernel33ProcMaskFilter(rb) {} - static SkFlattenable* Create(SkFlattenableReadBuffer& rb) - { - return new Darken(rb); - } -}; - -static SkMaskFilter* makemf() { return new Darken(0x30); } - -//#ifdef TEST_CLICKX - -static void test_typefaceCache() -{ - SkTypeface* t0 = SkTypeface::CreateFromName("sans-serif", - SkTypeface::kNormal); - SkTypeface* t1 = SkTypeface::CreateFromName(NULL, SkTypeface::kNormal); - SkTypeface* t2 = SkTypeface::CreateFromName("arial", SkTypeface::kNormal); - SkTypeface* t3 = SkTypeface::CreateFromName("helvetica", SkTypeface::kItalic); - -#ifndef SK_BUILD_FOR_MAC - SkASSERT(t0 == t1); - SkASSERT(t0 == t2); - SkASSERT(t0 == t3); -#endif -} - -static void test_breakText() -{ - SkPaint paint; - const char* text = "sdfkljAKLDFJKEWkldfjlk#$%&sdfs.dsj"; - size_t length = strlen(text); - SkScalar width = paint.measureText(text, length); - - SkScalar mm = 0; - SkScalar nn = 0; - for (SkScalar w = 0; w <= width; w += SK_Scalar1) - { - SkScalar m; - size_t n = paint.breakText(text, length, w, &m, - SkPaint::kBackward_TextBufferDirection); - - SkASSERT(n <= length); - SkASSERT(m <= width); - - if (n == 0) - SkASSERT(m == 0); - else - { - // now assert that we're monotonic - if (n == nn) - SkASSERT(m == mm); - else - { - SkASSERT(n > nn); - SkASSERT(m > mm); - } - } - nn = n; - mm = m; - } - - nn = paint.breakText(text, length, width, &mm); - SkASSERT(nn == length); - SkASSERT(mm == width); -} - -static SkRandom gRand; - -class SkPowerMode : public SkXfermode { -public: - SkPowerMode(SkScalar exponent) { this->init(exponent); } - - virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count, const SkAlpha aa[]); - - typedef SkFlattenable* (*Factory)(SkFlattenableReadBuffer&); - - // overrides for SkFlattenable - virtual Factory getFactory() { return Create; } - virtual void flatten(SkFlattenableWriteBuffer& b) - { - // this->INHERITED::flatten(b); How can we know if this is legal???? - b.write32(SkScalarToFixed(fExp)); - } - -private: - SkScalar fExp; // user's value - uint8_t fTable[256]; // cache - - void init(SkScalar exponent); - SkPowerMode(SkFlattenableReadBuffer& b) : SkXfermode(b) - { - // read the exponent - this->init(SkFixedToScalar(b.readS32())); - } - static SkFlattenable* Create(SkFlattenableReadBuffer& b) - { - return SkNEW_ARGS(SkPowerMode, (b)); - } - - typedef SkXfermode INHERITED; -}; - -void SkPowerMode::init(SkScalar e) -{ - fExp = e; - float ee = SkScalarToFloat(e); - - printf("------ %g\n", ee); - for (int i = 0; i < 256; i++) - { - float x = i / 255.f; - // printf(" %d %g", i, x); - x = powf(x, ee); - // printf(" %g", x); - int xx = SkScalarRound(SkFloatToScalar(x * 255)); - // printf(" %d\n", xx); - fTable[i] = SkToU8(xx); - } -} - -void SkPowerMode::xfer16(uint16_t dst[], const SkPMColor src[], int count, const SkAlpha aa[]) -{ - for (int i = 0; i < count; i++) - { - SkPMColor c = src[i]; - int r = SkGetPackedR32(c); - int g = SkGetPackedG32(c); - int b = SkGetPackedB32(c); - r = fTable[r]; - g = fTable[g]; - b = fTable[b]; - dst[i] = SkPack888ToRGB16(r, g, b); - } -} - -static const struct { - const char* fName; - uint32_t fFlags; - bool fFlushCache; -} gHints[] = { - { "Linear", SkPaint::kLinearText_Flag, false }, - { "Normal", 0, true }, - { "Subpixel", SkPaint::kSubpixelText_Flag, true } -}; - -#ifdef SK_DEBUG - #define REPEAT_COUNT 1 -#else - #define REPEAT_COUNT 5000 -#endif - -static int count_char_points(const SkPaint& paint, char c) -{ - SkPath path; - - paint.getTextPath(&c, 1, 0, 0, &path); - return path.getPoints(NULL, 0); -} - -static int gOld, gNew, gCount; - -static void dump(int c, int oldc, int newc) -{ - if (oldc != newc) - { - gOld += oldc; - gNew += newc; - gCount += 1; - printf("char %c: old = %3d, new = %3d, reduction %g%%\n", c, oldc, newc, 100. * (oldc - newc) / oldc); - } -} - -static void tab(int n) -{ -// printf("[%d] ", n); return; - SkASSERT(n >= 0); - for (int i = 0; i < n; i++) - printf(" "); -} - -#if 0 -#include "badrects.cpp" - -static void make_badrgn(SkRegion* rgn, int insetAmount) -{ - SkRect16 r, bounds; - int i; - - rgn->setEmpty(); - bounds.setEmpty(); - - for (i = 0; i < SK_ARRAY_COUNT(badrects); i++) - { - SkASSERT(badrects[i].width > 0 && badrects[i].height > 0); - - r.set(badrects[i].x, badrects[i].y, badrects[i].x + badrects[i].width, badrects[i].y + badrects[i].height); - r.inset(insetAmount, insetAmount); - rgn->op(r, SkRegion::kUnion_Op); - bounds.join(r); - } - SkASSERT(bounds == rgn->getBounds()); - - for (i = 0; i < SK_ARRAY_COUNT(badrects); i++) - { - r.set(badrects[i].x, badrects[i].y, badrects[i].x + badrects[i].width, badrects[i].y + badrects[i].height); - SkASSERT(rgn->contains(r)); - } -} -#endif - -static void draw_rgn(const SkRegion& rgn, SkCanvas* canvas, const SkPaint& paint) -{ - SkRect r; - SkRegion::Iterator iter(rgn); - - for (; !iter.done(); iter.next()) - { - r.set(iter.rect()); - canvas->drawRect(r, paint); - } -} - -static void test_break(SkCanvas* canvas, const char text[], size_t length, - SkScalar x, SkScalar y, const SkPaint& paint, - SkScalar clickX) -{ - SkPaint linePaint; - - linePaint.setAntiAlias(true); - - SkScalar measured; - - if (paint.breakText(text, length, clickX - x, &measured, SkPaint::kForward_TextBufferDirection)) - { - linePaint.setColor(SK_ColorRED); - canvas->drawLine(x, y, x + measured, y, linePaint); - } - - x += paint.measureText(text, length); - if (paint.breakText(text, length, x - clickX, &measured, SkPaint::kBackward_TextBufferDirection)) - { - linePaint.setColor(SK_ColorBLUE); - canvas->drawLine(x - measured, y, x, y, linePaint); - } -} - -static void test_poly() -{ - static const SkPoint dst[] = { - SkIntToScalar(2), SkIntToScalar(1), - SkIntToScalar(5), SkIntToScalar(1), - SkIntToScalar(5), SkIntToScalar(3), - SkIntToScalar(2), SkIntToScalar(3) - }; - - static const SkPoint src[] = { - SkIntToScalar(0), SkIntToScalar(0), - SkIntToScalar(1), SkIntToScalar(0), - SkIntToScalar(1), SkIntToScalar(1), - SkIntToScalar(0), SkIntToScalar(1) - }; - - SkMatrix matrix; - - if (matrix.setPolyToPoly(src, dst, 4)) - { - SkPoint pt = { SK_Scalar1/2, SK_Scalar1/2 }; - matrix.mapPoints(&pt, 1); - printf("---- x = %g y = %g\n", SkScalarToFloat(pt.fX), SkScalarToFloat(pt.fY)); - } - else - printf("---- setPolyToPoly failed\n"); -} - -#include "SkColorShader.h" - -static void DrawTheText(SkCanvas* canvas, const char text[], size_t length, - SkScalar x, SkScalar y, const SkPaint& paint, - SkScalar clickX, SkMaskFilter* mf) -{ - SkPaint p(paint); - -#if 0 - canvas->drawText(text, length, x, y, paint); -#else - { - SkPoint pts[1000]; - SkScalar xpos = x; - SkASSERT(length <= SK_ARRAY_COUNT(pts)); - for (size_t i = 0; i < length; i++) - pts[i].set(xpos, y), xpos += paint.getTextSize(); - canvas->drawPosText(text, length, pts, paint); - } -#endif - - p.setSubpixelText(true); - x += SkIntToScalar(180); - canvas->drawText(text, length, x, y, p); - -#ifdef TEST_CLICKX - test_break(canvas, text, length, x, y, p, clickX); -#endif - -#ifdef SK_DEBUG - if (false) - { - SkColorShader shader; - p.setShader(&shader); - x += SkIntToScalar(180); - canvas->drawText(text, length, x, y, p); - p.setShader(NULL); - } - - if (true) - { - // p.setMaskFilter(mf); - p.setSubpixelText(false); - p.setLinearText(true); - x += SkIntToScalar(180); - canvas->drawText(text, length, x, y, p); - } -#endif -} - -class TextSpeedView : public SkView { -public: - TextSpeedView() - { - fMF = makemf(); - - fHints = 0; - - if (false) - { - static const char extra[] = { '.', ',', ':', ';', '!' }; - SkPaint paint, paint2; - - paint2.setTypeface(SkTypeface::CreateFromName(NULL, - SkTypeface::kItalic))->unref(); - - for (int i = 0; i < 26; i++) - ::dump('a' + i, count_char_points(paint, 'a' + i), count_char_points(paint2, 'a' + i)); - for (int j = 0; j < SK_ARRAY_COUNT(extra); j++) - ::dump(extra[j], count_char_points(paint, extra[j]), count_char_points(paint2, extra[j])); - - printf("--- ave reduction = %g%%\n", 100. * (gOld - gNew) / gOld); - } - - if (true) - { - SkPoint pts[] = { SkIntToScalar(20), 0, SkIntToScalar(256+20), 0 }; - SkColor colors[] = { SkColorSetARGB(0, 255, 255, 255), SkColorSetARGB(255, 255, 255, 255) }; - fGradient = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode); - } - - fClickX = 0; - - test_breakText(); - test_typefaceCache(); - test_poly(); - } - - virtual ~TextSpeedView() - { - fGradient->unref(); - fMF->safeUnref(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Text"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(SK_ColorWHITE); - // canvas->drawColor(SK_ColorBLACK); - } - - static void make_textstrip(SkBitmap* bm) - { - bm->setConfig(SkBitmap::kRGB_565_Config, 200, 18); - bm->allocPixels(); - bm->eraseColor(SK_ColorWHITE); - - SkCanvas canvas(*bm); - SkPaint paint; - const char* s = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit"; - - paint.setFlags(paint.getFlags() | SkPaint::kAntiAlias_Flag - | SkPaint::kDevKernText_Flag); - paint.setTextSize(SkIntToScalar(14)); - canvas.drawText(s, strlen(s), SkIntToScalar(8), SkIntToScalar(14), paint); - } - - static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) - { - for (size_t i = 0; i < n; i++) - pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480); - } - - virtual void onDraw(SkCanvas* canvas) - { - if (false) - { - canvas->translate(SkIntToScalar(480), 0); - canvas->rotate(SkIntToScalar(90)); - } - - this->drawBG(canvas); - - if (false) - { - SkPaint p; - - p.setAntiAlias(true); - p.setSubpixelText(true); - // p.setLinearText(true); - - SkScalar size = SkIntToScalar(6); - SkMSec dur = 0; - const int LOOP = 16; - const int TIMES = 10; - - for (int times = 0; times < TIMES; times++) - { - SkMSec now = SkTime::GetMSecs(); - for (int loop = 0; loop < LOOP; loop++) - { - p.setTextSize(size); - size += SK_Scalar1/5; - canvas->drawText("Hamburgefons", 12, SkIntToScalar(10), SkIntToScalar(50), p); - } - dur += SkTime::GetMSecs() - now; - SkGraphics::SetFontCacheUsed(0); - } - - printf("----- duration = %g\n", dur * 1.0 / TIMES); - this->inval(NULL); - return; - } - - if (false) - { - SkPaint p; - p.setAntiAlias(true); - for (int i = 6; i <= 36; i++) - { - SkRect r; - SkPaint::FontMetrics m; - p.setTextSize(SkIntToScalar(i)); - p.getFontMetrics(&m); - int ascent = SkScalarRound(m.fAscent); - int descent = SkScalarRound(m.fDescent); - for (uint8_t c = ' '; c <= 127; c++) - { - p.getTextWidths(&c, 1, NULL, &r); - if (SkScalarRound(r.fTop) < ascent) - printf("PS %d --- %c [%d] top=%g, ascent=%g ymax=%g\n", i, c, c, - SkScalarToFloat(r.fTop), SkScalarToFloat(m.fAscent), SkScalarToFloat(m.fTop)); - if (SkScalarRound(r.fBottom) > descent) - printf("PS %d --- %c [%d] bottom=%g, descent=%g ymin=%g\n", i, c, c, - SkScalarToFloat(r.fBottom), SkScalarToFloat(m.fDescent), SkScalarToFloat(m.fBottom)); - } - } - } - - if (false) - { - SkPaint p; - p.setShader(fGradient); - -#ifdef SK_RELEASE - SkMSec now = SkTime::GetMSecs(); - for (int i = 0; i < 100; i++) -#endif - canvas->drawPaint(p); -#ifdef SK_RELEASE - printf("----- %d ms\n", SkTime::GetMSecs() - now); - this->inval(NULL); -#endif - return; - } - - if (false) - { - SkBitmap bm; - - make_textstrip(&bm); - canvas->translate(0, SkIntToScalar(50)); - for (int i = 0; i < 10; i++) - { - float gamma = 1 + i * 0.2f; - SkPowerMode mode(SkFloatToScalar(1 / gamma)); - SkPaint p; - p.setXfermode(&mode); - - canvas->drawBitmap(bm, 0, SkIntToScalar(i) * bm.height(), &p); - } - return; - } - - if (false) - { - SkPaint paint; - - paint.setAntiAlias(true); - paint.setDevKernText(true); - SkMSec now = SkTime::GetMSecs(); - for (int i = 0; i < 1000000; i++) - { - paint.measureText("Hamburgefons", 15, NULL, NULL); - } - printf("--------- measure %d\n", SkTime::GetMSecs() - now); - this->inval(NULL); - return; - } - - if (false) - { - SkRegion rgn; - SkPath path; - SkPaint paint; - - // make_badrgn(&rgn, -2); - - if (false) - { - paint.setColor(SK_ColorBLUE); - canvas->drawIRect(rgn.getBounds(), paint); - } - paint.setColor(SK_ColorRED); - draw_rgn(rgn, canvas, paint); - - rgn.getBoundaryPath(&path); - paint.setARGB(0x80, 0, 0, 0xFF); - canvas->drawPath(path, paint); - return; - } - - if (false) - { - SkRect r = { SkIntToScalar(50), SkIntToScalar(50), SkIntToScalar(300), SkIntToScalar(300) }; - SkPaint p; - - p.setStyle(SkPaint::kStroke_Style); - p.setAlpha(0x80); - p.setStrokeWidth(SkIntToScalar(20)); - canvas->drawRect(r, p); - } - - if (false) - { - SkPaint p; - SkRect r = { SkIntToScalar(100), SkIntToScalar(100), SkIntToScalar(104), SkIntToScalar(104) }; - // r.offset(SK_ScalarHalf, SK_ScalarHalf); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1*2); - // p.setAntiAliasOn(true); - canvas->drawRect(r, p); - return; - } - - if (false) - { - Sk64 aa, bb; - int64_t a = (int64_t)6062080 * -30596; - int64_t b = (int64_t)4816896 * 57957; - aa.setMul(6062080, -30596); - bb.setMul(4816896, 57957); - - a += b; - b = a >> 16; - -// SkFixed c = aa.addGetFixed(bb); - - printf("%d %d\n", (int)a, a >> 32); - - SkBitmap bm; - SkPaint paint; - SkScalar scale = SkFloatToScalar(0.5625f); - SkScalar x = SkIntToScalar(100); - SkScalar y = SkIntToScalar(100); - - //paint.setFilterType(SkPaint::kBilinear_FilterType); - - SkImageDecoder::DecodeFile("/app_web_browser.png", &bm); - - // canvas->drawBitmap(bm, x, y, paint); - x += SkIntToScalar(100); - canvas->save(); - canvas->translate(x, y); - canvas->scale(SkIntToScalar(2)/1, SkIntToScalar(2)/1); - canvas->translate(-x, -y); - canvas->drawBitmap(bm, x, y, &paint); - canvas->restore(); - x += SkIntToScalar(100); - canvas->save(); - canvas->translate(x, y); - canvas->scale(scale, scale); - canvas->translate(-x, -y); - // canvas->drawBitmap(bm, x, y, paint); - canvas->restore(); - return; - } - - SkAutoCanvasRestore restore(canvas, false); - { - SkRect r; - r.set(0, 0, SkIntToScalar(1000), SkIntToScalar(20)); - // canvas->saveLayer(&r, NULL, SkCanvas::kHasAlphaLayer_SaveFlag); - } - - SkPaint paint; -// const uint16_t glyphs[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 }; - int index = fHints % SK_ARRAY_COUNT(gHints); - index = 1; -// const char* style = gHints[index].fName; - -// canvas->translate(0, SkIntToScalar(50)); - - // canvas->drawText(style, strlen(style), SkIntToScalar(20), SkIntToScalar(20), paint); - -// paint.setTypeface(SkTypeface::Create(NULL, SkTypeface::kItalic))->unref(); - paint.setAntiAlias(true); - paint.setFlags(paint.getFlags() | gHints[index].fFlags); - - SkMSec now = 0; - if (REPEAT_COUNT > 1) - now = SkTime::GetMSecs(); - - SkRect clip; - clip.set(SkIntToScalar(25), SkIntToScalar(34), SkIntToScalar(88), SkIntToScalar(155)); - - if (0) { - canvas->clipRect(clip); - } - - if (0) { - SkPath clipPath; - clipPath.addOval(clip); - canvas->clipPath(clipPath); - } - - const char* text = "Hamburgefons"; - size_t length = strlen(text); - -#ifdef TEST_CLICKX - { - SkPaint p; - - p.setColor(SK_ColorGREEN); - p.setAntiAlias(true); - canvas->drawLine(fClickX, 0, fClickX, SkIntToScalar(1000), p); - } -#endif - - for (int j = 0; j < REPEAT_COUNT; j++) - { - SkScalar y = SkIntToScalar(0); - for (int i = 9; i <= 24; i++) { - paint.setTextSize(SkIntToScalar(i) /*+ (gRand.nextU() & 0xFFFF)*/); - for (SkScalar dx = 0; dx <= SkIntToScalar(3)/4; dx += SkIntToScalar(1) /* /4 */) - { - y += paint.getFontSpacing(); - DrawTheText(canvas, text, length, SkIntToScalar(20) + dx, y, paint, fClickX, fMF); - } - } - if (gHints[index].fFlushCache) { - SkGraphics::SetFontCacheUsed(0); - } - } - - if (REPEAT_COUNT > 1) - { - printf("--------- FPS = %g\n", REPEAT_COUNT * 1000. / (SkTime::GetMSecs() - now)); - this->inval(NULL); - } - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - fClickX = x; - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - int fHints; - SkScalar fClickX; - SkMaskFilter* fMF; - SkShader* fGradient; - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new TextSpeedView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleTextAlpha.cpp b/samplecode/SampleTextAlpha.cpp deleted file mode 100644 index d695f23..0000000 --- a/samplecode/SampleTextAlpha.cpp +++ /dev/null @@ -1,122 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkBlurMaskFilter.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" - -#include "SkImageRef.h" -#include "SkOSFile.h" -#include "SkStream.h" - -static void check_for_nonwhite(const SkBitmap& bm, int alpha) { - if (bm.config() != SkBitmap::kRGB_565_Config) { - return; - } - - for (int y = 0; y < bm.height(); y++) { - for (int x = 0; x < bm.width(); x++) { - uint16_t c = *bm.getAddr16(x, y); - if (c != 0xFFFF) { - SkDebugf("------ nonwhite alpha=%x [%d %d] %x\n", alpha, x, y, c); - return; - } - } - } -} - -class TextAlphaView : public SkView { -public: - TextAlphaView() { - fByte = 0xFF; - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SkString str("TextAlpha"); - SampleCode::TitleR(evt, str.c_str()); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - const char* str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - SkPaint paint; - SkScalar x = SkIntToScalar(10); - SkScalar y = SkIntToScalar(20); - - paint.setFlags(0x105); - - paint.setARGB(fByte, 0xFF, 0xFF, 0xFF); - - paint.setMaskFilter(SkBlurMaskFilter::Create(SkIntToScalar(3), - SkBlurMaskFilter::kNormal_BlurStyle)); - paint.getMaskFilter()->unref(); - - SkRandom rand; - - for (int ps = 6; ps <= 35; ps++) { - paint.setColor(rand.nextU() | (0xFF << 24)); - paint.setTextSize(SkIntToScalar(ps)); - paint.setTextSize(SkIntToScalar(24)); - canvas->drawText(str, strlen(str), x, y, paint); - y += paint.getFontMetrics(NULL); - } - //check_for_nonwhite(canvas->getDevice()->accessBitmap(), fByte); - //SkDebugf("------ byte %x\n", fByte); - - if (false) { - fByte += 1; - fByte &= 0xFF; - this->inval(NULL); - } - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - return new Click(this); - } - - virtual bool onClick(Click* click) { - int y = click->fICurr.fY; - if (y < 0) { - y = 0; - } else if (y > 255) { - y = 255; - } - fByte = y; - this->inval(NULL); - return true; - } - -private: - int fByte; - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new TextAlphaView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleTextEffects.cpp b/samplecode/SampleTextEffects.cpp deleted file mode 100644 index f64e187..0000000 --- a/samplecode/SampleTextEffects.cpp +++ /dev/null @@ -1,467 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTypeface.h" -#include "SkAvoidXfermode.h" - -static inline SkPMColor rgb2gray(SkPMColor c) -{ - unsigned r = SkGetPackedR32(c); - unsigned g = SkGetPackedG32(c); - unsigned b = SkGetPackedB32(c); - - unsigned x = r * 5 + g * 7 + b * 4 >> 4; - - return SkPackARGB32(0, x, x, x) | (c & (SK_A32_MASK << SK_A32_SHIFT)); -} - -class SkGrayScaleColorFilter : public SkColorFilter { -public: - virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[]) - { - for (int i = 0; i < count; i++) - result[i] = rgb2gray(src[i]); - } -}; - -class SkChannelMaskColorFilter : public SkColorFilter { -public: - SkChannelMaskColorFilter(U8CPU redMask, U8CPU greenMask, U8CPU blueMask) - { - fMask = SkPackARGB32(0xFF, redMask, greenMask, blueMask); - } - - virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[]) - { - SkPMColor mask = fMask; - for (int i = 0; i < count; i++) - result[i] = src[i] & mask; - } - -private: - SkPMColor fMask; -}; - -/////////////////////////////////////////////////////////// - -#include "SkGradientShader.h" -#include "SkLayerRasterizer.h" -#include "SkBlurMaskFilter.h" - -static void r0(SkLayerRasterizer* rast, SkPaint& p) -{ - p.setMaskFilter(SkBlurMaskFilter::Create(SkIntToScalar(3), - SkBlurMaskFilter::kNormal_BlurStyle))->unref(); - rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); - - p.setMaskFilter(NULL); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1); - rast->addLayer(p); - - p.setAlpha(0x11); - p.setStyle(SkPaint::kFill_Style); - p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode); - rast->addLayer(p); -} - -static void r1(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - p.setAlpha(0x40); - p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1*2); - rast->addLayer(p); -} - -static void r2(SkLayerRasterizer* rast, SkPaint& p) -{ - p.setStyle(SkPaint::kStrokeAndFill_Style); - p.setStrokeWidth(SK_Scalar1*4); - rast->addLayer(p); - - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1*3/2); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p); -} - -static void r3(SkLayerRasterizer* rast, SkPaint& p) -{ - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1*3); - rast->addLayer(p); - - p.setAlpha(0x20); - p.setStyle(SkPaint::kFill_Style); - p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode); - rast->addLayer(p); -} - -static void r4(SkLayerRasterizer* rast, SkPaint& p) -{ - p.setAlpha(0x60); - rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); - - p.setAlpha(0xFF); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p, SK_Scalar1*3/2, SK_Scalar1*3/2); - - p.setXfermode(NULL); - rast->addLayer(p); -} - -#include "SkDiscretePathEffect.h" - -static void r5(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - p.setPathEffect(new SkDiscretePathEffect(SK_Scalar1*4, SK_Scalar1*3))->unref(); - p.setPorterDuffXfermode(SkPorterDuff::kSrcOut_Mode); - rast->addLayer(p); -} - -static void r6(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - p.setAntiAlias(false); - SkLayerRasterizer* rast2 = new SkLayerRasterizer; - r5(rast2, p); - p.setRasterizer(rast2)->unref(); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p); -} - -#include "Sk2DPathEffect.h" - -class Dot2DPathEffect : public Sk2DPathEffect { -public: - Dot2DPathEffect(SkScalar radius, const SkMatrix& matrix) - : Sk2DPathEffect(matrix), fRadius(radius) {} - - virtual void flatten(SkFlattenableWriteBuffer& buffer) - { - this->INHERITED::flatten(buffer); - - buffer.writeScalar(fRadius); - } - virtual Factory getFactory() { return CreateProc; } - -protected: - virtual void next(const SkPoint& loc, int u, int v, SkPath* dst) - { - dst->addCircle(loc.fX, loc.fY, fRadius); - } - - Dot2DPathEffect(SkFlattenableReadBuffer& buffer) : Sk2DPathEffect(buffer) - { - fRadius = buffer.readScalar(); - } -private: - SkScalar fRadius; - - static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) - { - return new Dot2DPathEffect(buffer); - } - - typedef Sk2DPathEffect INHERITED; -}; - -static void r7(SkLayerRasterizer* rast, SkPaint& p) -{ - SkMatrix lattice; - lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0); - lattice.postSkew(SK_Scalar1/3, 0, 0, 0); - p.setPathEffect(new Dot2DPathEffect(SK_Scalar1*4, lattice))->unref(); - rast->addLayer(p); -} - -static void r8(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - SkMatrix lattice; - lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0); - lattice.postSkew(SK_Scalar1/3, 0, 0, 0); - p.setPathEffect(new Dot2DPathEffect(SK_Scalar1*2, lattice))->unref(); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p); - - p.setPathEffect(NULL); - p.setXfermode(NULL); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1); - rast->addLayer(p); -} - -class Line2DPathEffect : public Sk2DPathEffect { -public: - Line2DPathEffect(SkScalar width, const SkMatrix& matrix) - : Sk2DPathEffect(matrix), fWidth(width) {} - - virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width) - { - if (this->INHERITED::filterPath(dst, src, width)) - { - *width = fWidth; - return true; - } - return false; - } - - virtual Factory getFactory() { return CreateProc; } - virtual void flatten(SkFlattenableWriteBuffer& buffer) - { - this->INHERITED::flatten(buffer); - buffer.writeScalar(fWidth); - } -protected: - virtual void nextSpan(int u, int v, int ucount, SkPath* dst) - { - if (ucount > 1) - { - SkPoint src[2], dstP[2]; - - src[0].set(SkIntToScalar(u) + SK_ScalarHalf, - SkIntToScalar(v) + SK_ScalarHalf); - src[1].set(SkIntToScalar(u+ucount) + SK_ScalarHalf, - SkIntToScalar(v) + SK_ScalarHalf); - this->getMatrix().mapPoints(dstP, src, 2); - - dst->moveTo(dstP[0]); - dst->lineTo(dstP[1]); - } - } - - Line2DPathEffect::Line2DPathEffect(SkFlattenableReadBuffer& buffer) : Sk2DPathEffect(buffer) - { - fWidth = buffer.readScalar(); - } - -private: - SkScalar fWidth; - - static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) - { - return new Line2DPathEffect(buffer); - } - - typedef Sk2DPathEffect INHERITED; -}; - -static void r9(SkLayerRasterizer* rast, SkPaint& p) -{ - rast->addLayer(p); - - SkMatrix lattice; - lattice.setScale(SK_Scalar1, SK_Scalar1*6, 0, 0); - lattice.postRotate(SkIntToScalar(30), 0, 0); - p.setPathEffect(new Line2DPathEffect(SK_Scalar1*2, lattice))->unref(); - p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode); - rast->addLayer(p); - - p.setPathEffect(NULL); - p.setXfermode(NULL); - p.setStyle(SkPaint::kStroke_Style); - p.setStrokeWidth(SK_Scalar1); - rast->addLayer(p); -} - -typedef void (*raster_proc)(SkLayerRasterizer*, SkPaint&); - -static const raster_proc gRastProcs[] = { - r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 -}; - -static const struct { - SkColor fMul, fAdd; -} gLightingColors[] = { - { 0x808080, 0x800000 }, // general case - { 0x707070, 0x707070 }, // no-pin case - { 0xFFFFFF, 0x800000 }, // just-add case - { 0x808080, 0x000000 }, // just-mul case - { 0xFFFFFF, 0x000000 } // identity case -}; - -#include "SkXfermode.h" - -static unsigned color_dist16(uint16_t a, uint16_t b) -{ - unsigned dr = SkAbs32(SkPacked16ToR32(a) - SkPacked16ToR32(b)); - unsigned dg = SkAbs32(SkPacked16ToG32(a) - SkPacked16ToG32(b)); - unsigned db = SkAbs32(SkPacked16ToB32(a) - SkPacked16ToB32(b)); - - return SkMax32(dr, SkMax32(dg, db)); -} - -static unsigned scale_dist(unsigned dist, unsigned scale) -{ - dist >>= 6; - dist = (dist << 2) | dist; - dist = (dist << 4) | dist; - return dist; - -// return SkAlphaMul(dist, scale); -} - -static void apply_shader(SkPaint* paint, int index) -{ - raster_proc proc = gRastProcs[index]; - if (proc) - { - SkPaint p; - SkLayerRasterizer* rast = new SkLayerRasterizer; - - p.setAntiAlias(true); - proc(rast, p); - paint->setRasterizer(rast)->unref(); - } - -#if 0 - SkScalar dir[] = { SK_Scalar1, SK_Scalar1, SK_Scalar1 }; - paint->setMaskFilter(SkBlurMaskFilter::CreateEmboss(dir, SK_Scalar1/4, SkIntToScalar(4), SkIntToScalar(3)))->unref(); -#endif - paint->setColor(SK_ColorBLUE); -} - -static int gRastIndex; - -class TextEffectView : public SkView { - SkTypeface* fFace; -public: - TextEffectView() - { - fFace = SkTypeface::CreateFromFile("/Users/reed/Downloads/p052024l.pfb"); - } - - virtual ~TextEffectView() - { - fFace->safeUnref(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) - { - if (SampleCode::TitleQ(*evt)) - { - SampleCode::TitleR(evt, "Text Effects"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) - { -// canvas->drawColor(0xFFDDDDDD); - canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) - { - this->drawBG(canvas); - - canvas->save(); -// canvas->scale(SK_Scalar1*2, SK_Scalar1*2, 0, 0); - - SkScalar x = SkIntToScalar(20); - SkScalar y = SkIntToScalar(40); - SkPaint paint; - - paint.setAntiAlias(true); - paint.setTextSize(SkIntToScalar(48)); - paint.setTypeface(SkTypeface::CreateFromName("sans-serif", - SkTypeface::kBold)); - - SkString str("GOOGLE "); - str.appendUnichar(0x5700); - - paint.setTypeface(fFace); - - for (int i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) - { - apply_shader(&paint, i); - - // paint.setMaskFilter(NULL); - // paint.setColor(SK_ColorBLACK); - -#if 0 - int index = i % SK_ARRAY_COUNT(gLightingColors); - paint.setColorFilter(SkColorFilter::CreateLightingFilter( - gLightingColors[index].fMul, - gLightingColors[index].fAdd))->unref(); -#endif - - canvas->drawText(str.c_str(), str.size(), x, y, paint); - - if (0) - { - SkPath path; - paint.getTextPath(str.c_str(), str.size(), x + SkIntToScalar(260), y, &path); - canvas->drawPath(path, paint); - } - - y += paint.getFontSpacing(); - } - - canvas->restore(); - - if (0) - { - SkPoint pts[] = { 0, 0, 0, SkIntToScalar(150) }; - SkColor colors[] = { 0xFFE6E6E6, 0xFFFFFFFF }; - SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode); - - paint.reset(); - paint.setShader(s); - canvas->drawRectCoords(0, 0, SkIntToScalar(120), SkIntToScalar(150), paint); - } - - if (1) - { - SkAvoidXfermode mode(SK_ColorWHITE, 0xFF, - SkAvoidXfermode::kTargetColor_Mode); - SkPaint paint; - x += SkIntToScalar(20); - SkRect r = { x, 0, x + SkIntToScalar(360), SkIntToScalar(700) }; - paint.setXfermode(&mode); - paint.setColor(SK_ColorGREEN); - paint.setAntiAlias(true); - canvas->drawOval(r, paint); - } - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) - { - gRastIndex = (gRastIndex + 1) % SK_ARRAY_COUNT(gRastProcs); - this->inval(NULL); - - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) - { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new TextEffectView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleTextOnPath.cpp b/samplecode/SampleTextOnPath.cpp deleted file mode 100644 index aec8fd6..0000000 --- a/samplecode/SampleTextOnPath.cpp +++ /dev/null @@ -1,314 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPackBits.h" -#include "SkPath.h" -#include "SkPathMeasure.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTypeface.h" -#include "SkAvoidXfermode.h" - -#define REPEAT_COUNT 1 - -static const char gText[] = "Hamburgefons"; - -static bool gDevKern; - -static void rand_text(char text[], SkRandom& rand, size_t count) { - for (size_t i = 0; i < count; i++) { - text[i] = rand.nextU() & 0x7F; - } -} - -static SkScalar sum_widths(const SkScalar widths[], int count) { - SkScalar w = 0; - for (int i = 0; i < count; i++) { - w += widths[i]; - } - return w; -} - -static void test_measure(const SkPaint& paint) { - char text[256]; - SkScalar widths[256]; - SkRect rects[256]; - SkRect bounds; - int count = 256; - - SkRandom rand; - - for (int i = 0; i < 100; i++) { - rand_text(text, rand, 256); - paint.getTextWidths(text, count, widths, NULL); - SkScalar tw0 = sum_widths(widths, count); - paint.getTextWidths(text, count, widths, rects); - SkScalar tw1 = sum_widths(widths, count); - SkASSERT(tw0 == tw1); - - SkScalar w0 = paint.measureText(text, count, NULL); - SkScalar w1 = paint.measureText(text, count, &bounds); - SkASSERT(w0 == w1); - SkASSERT(w0 == tw0); - - SkRect r = rects[0]; - SkScalar x = 0; - for (int j = 1; j < count; j++) { - x += widths[j-1]; - rects[j].offset(x, 0); - r.join(rects[j]); - } - SkASSERT(r == bounds); - - if (r != bounds) { - printf("flags=%x i=%d [%g %g %g %g] [%g %g %g %g]\n", - paint.getFlags(), i, - SkScalarToFloat(r.fLeft), - SkScalarToFloat(r.fTop), - SkScalarToFloat(r.fRight), - SkScalarToFloat(r.fBottom), - SkScalarToFloat(bounds.fLeft), - SkScalarToFloat(bounds.fTop), - SkScalarToFloat(bounds.fRight), - SkScalarToFloat(bounds.fBottom)); - } - } -} - -static void test_measure() { - SkPaint paint; - - for (int i = 0; i <= SkPaint::kAllFlags; i++) { - paint.setFlags(i); - test_measure(paint); - } -} - -////////////////////////////////////////////////////////////////////////////// - -static void test_textBounds(SkCanvas* canvas) { -// canvas->scale(SK_Scalar1/2, SK_Scalar1/2); - -// canvas->rotate(SkIntToScalar(30)); - - gDevKern = !gDevKern; - - SkScalar x = SkIntToScalar(50); - SkScalar y = SkIntToScalar(150); - SkScalar w[100]; - SkRect r[100], bounds; - - SkPaint paint; - paint.setTextSize(SkIntToScalar(64)); - paint.setAntiAlias(true); - paint.setDevKernText(gDevKern); - - (void)paint.measureText(gText, strlen(gText), &bounds, NULL); - paint.setColor(SK_ColorGREEN); - bounds.offset(x, y); - canvas->drawRect(bounds, paint); - - int count = paint.getTextWidths(gText, strlen(gText), w, r); - - paint.setColor(SK_ColorRED); - for (int i = 0; i < count; i++) { - r[i].offset(x, y); - canvas->drawRect(r[i], paint); - x += w[i]; - } - x = SkIntToScalar(50); - paint.setColor(gDevKern ? SK_ColorDKGRAY : SK_ColorBLACK); - canvas->drawText(gText, strlen(gText), x, y, paint); -} - -static void create_src(SkBitmap* bitmap, SkBitmap::Config config) { - bitmap->setConfig(config, 100, 100); - bitmap->allocPixels(); - bitmap->eraseColor(0); - - SkCanvas canvas(*bitmap); - SkPaint paint; - - paint.setAntiAlias(true); - canvas.drawCircle(SkIntToScalar(50), SkIntToScalar(50), - SkIntToScalar(50), paint); -} - -static void blur(SkBitmap* dst, const SkBitmap& src, SkScalar radius) { - *dst = src; -} - -static void test_bitmap_blur(SkCanvas* canvas) { - SkBitmap src, dst; - - create_src(&src, SkBitmap::kARGB_8888_Config); - blur(&dst, src, SkIntToScalar(4)); - - SkPaint paint; - - paint.setColor(SK_ColorRED); - - canvas->drawBitmap(dst, SkIntToScalar(30), SkIntToScalar(60), &paint); -} - -static SkScalar getpathlen(const SkPath& path) { - SkPathMeasure meas(path, false); - return meas.getLength(); -} - -static void test_textpathmatrix(SkCanvas* canvas) { - SkPaint paint; - SkPath path; - SkMatrix matrix; - - path.moveTo(SkIntToScalar(200), SkIntToScalar(300)); - path.quadTo(SkIntToScalar(400), SkIntToScalar(100), - SkIntToScalar(600), SkIntToScalar(300)); - - paint.setAntiAlias(true); - - paint.setStyle(SkPaint::kStroke_Style); - canvas->drawPath(path, paint); - paint.setStyle(SkPaint::kFill_Style); - paint.setTextSize(SkIntToScalar(48)); - paint.setTextAlign(SkPaint::kRight_Align); - - const char* text = "Android"; - size_t len = strlen(text); - SkScalar pathLen = getpathlen(path); - - canvas->drawTextOnPath(text, len, path, NULL, paint); - - paint.setColor(SK_ColorRED); - matrix.setScale(-SK_Scalar1, SK_Scalar1); - matrix.postTranslate(pathLen, 0); - canvas->drawTextOnPath(text, len, path, &matrix, paint); - - paint.setColor(SK_ColorBLUE); - matrix.setScale(SK_Scalar1, -SK_Scalar1); - canvas->drawTextOnPath(text, len, path, &matrix, paint); - - paint.setColor(SK_ColorGREEN); - matrix.setScale(-SK_Scalar1, -SK_Scalar1); - matrix.postTranslate(pathLen, 0); - canvas->drawTextOnPath(text, len, path, &matrix, paint); -} - -class TextOnPathView : public SkView { -public: - SkPath fPath; - SkScalar fHOffset; - - TextOnPathView() { - SkRect r; - r.set(SkIntToScalar(100), SkIntToScalar(100), - SkIntToScalar(300), SkIntToScalar(300)); - fPath.addOval(r); - - fHOffset = SkIntToScalar(50); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Text On Path"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); -#if 0 - SkRect r; - SkPaint p; - SkRandom rand; - p.setAntiAlias(true); - - for (int i = 0; i < 100; i++) { - SkScalar x = rand.nextUScalar1() * 300 + SkIntToScalar(50); - SkScalar y = rand.nextUScalar1() * 200 + SkIntToScalar(50); - SkScalar w = rand.nextUScalar1() * 10; - SkScalar h = rand.nextUScalar1() * 10; - r.set(x, y, x + w, y + h); - canvas->drawRect(r, p); - } - - test_textBounds(canvas); -// return; - - SkBitmap bm; - if (SkImageDecoder::DecodeFile("/loading_tile.png", - &bm, SkBitmap::kRGB_565_Config, true)) - canvas->drawBitmap(bm, 0, 0); -#endif - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkPaint paint; - - paint.setAntiAlias(true); - paint.setTextSize(SkIntToScalar(50)); - - for (int j = 0; j < REPEAT_COUNT; j++) { - SkScalar x = fHOffset; - - paint.setColor(SK_ColorBLACK); - canvas->drawTextOnPathHV(gText, sizeof(gText)-1, fPath, - x, paint.getTextSize()/2, paint); - - paint.setColor(SK_ColorRED); - canvas->drawTextOnPathHV(gText, sizeof(gText)-1, fPath, - x + SkIntToScalar(50), 0, paint); - - paint.setColor(SK_ColorBLUE); - canvas->drawTextOnPathHV(gText, sizeof(gText)-1, fPath, - x + SkIntToScalar(100), -paint.getTextSize()/2, paint); - } - - paint.setColor(SK_ColorGREEN); - paint.setStyle(SkPaint::kStroke_Style); - canvas->drawPath(fPath, paint); - - canvas->translate(SkIntToScalar(200), 0); - test_textpathmatrix(canvas); - - test_bitmap_blur(canvas); - - if (REPEAT_COUNT > 1) - this->inval(NULL); - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - fHints += 1; - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - -private: - int fHints; - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { - return new TextOnPathView; -} - -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp deleted file mode 100644 index 759c17c..0000000 --- a/samplecode/SampleTiling.cpp +++ /dev/null @@ -1,170 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkPaint.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTypeface.h" - -// effects -#include "SkGradientShader.h" -#include "SkUnitMappers.h" -#include "SkBlurDrawLooper.h" - -static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) { - bm->setConfig(config, w, h); - bm->allocPixels(); - bm->eraseColor(0); - - SkCanvas canvas(*bm); - SkPoint pts[] = { 0, 0, SkIntToScalar(w), SkIntToScalar(h) }; - SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE }; - SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 }; - SkPaint paint; - - SkUnitMapper* um = NULL; - - um = new SkCosineMapper; -// um = new SkDiscreteMapper(12); - - SkAutoUnref au(um); - - paint.setDither(true); - paint.setShader(SkGradientShader::CreateLinear(pts, colors, pos, - SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode, um))->unref(); - canvas.drawPaint(paint); -} - -static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, - SkShader::TileMode tmx, SkShader::TileMode tmy) { - SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy); - paint->setShader(shader)->unref(); - paint->setFilterBitmap(filter); -} - -static const SkBitmap::Config gConfigs[] = { - SkBitmap::kARGB_8888_Config, - SkBitmap::kRGB_565_Config, - SkBitmap::kARGB_4444_Config -}; -static const int gWidth = 32; -static const int gHeight = 32; - -class TilingView : public SkView { - SkBlurDrawLooper fLooper; -public: - TilingView() - : fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2), - 0x88000000) { - for (int i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) { - makebm(&fTexture[i], gConfigs[i], gWidth, gHeight); - } - } - - SkBitmap fTexture[SK_ARRAY_COUNT(gConfigs)]; - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Tiling"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkRect r = { 0, 0, SkIntToScalar(gWidth*2), SkIntToScalar(gHeight*2) }; - - static const char* gConfigNames[] = { "8888", "565", "4444" }; - - static const bool gFilters[] = { false, true }; - static const char* gFilterNames[] = { "point", "bilinear" }; - - static const SkShader::TileMode gModes[] = { SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMirror_TileMode }; - static const char* gModeNames[] = { "C", "R", "M" }; - - SkScalar y = SkIntToScalar(24); - SkScalar x = SkIntToScalar(10); - - for (int kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) { - for (int ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) { - SkPaint p; - SkString str; - p.setAntiAlias(true); - p.setDither(true); - p.setLooper(&fLooper); - str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]); - - p.setTextAlign(SkPaint::kCenter_Align); - canvas->drawText(str.c_str(), str.size(), x + r.width()/2, y, p); - - x += r.width() * 4 / 3; - } - } - - y += SkIntToScalar(16); - - for (int i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) { - for (int j = 0; j < SK_ARRAY_COUNT(gFilters); j++) { - x = SkIntToScalar(10); - for (int kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) { - for (int ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) { - SkPaint paint; - setup(&paint, fTexture[i], gFilters[j], gModes[kx], gModes[ky]); - paint.setDither(true); - - canvas->save(); - canvas->translate(x, y); - canvas->drawRect(r, paint); - canvas->restore(); - - x += r.width() * 4 / 3; - } - } - { - SkPaint p; - SkString str; - p.setAntiAlias(true); - p.setLooper(&fLooper); - str.printf("%s, %s", gConfigNames[i], gFilterNames[j]); - canvas->drawText(str.c_str(), str.size(), x, y + r.height() * 2 / 3, p); - } - - y += r.height() * 4 / 3; - } - } - - #ifdef SK_RELEASE - this->inval(NULL); - #endif - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - this->inval(NULL); - return this->INHERITED::onFindClickHandler(x, y); - } - - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new TilingView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleTypeface.cpp b/samplecode/SampleTypeface.cpp deleted file mode 100644 index b1289bd..0000000 --- a/samplecode/SampleTypeface.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkTypeface.h" -#include "SkPath.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "Sk1DPathEffect.h" -#include "SkCornerPathEffect.h" -#include "SkPathMeasure.h" -#include "SkRandom.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkDither.h" - -static const struct { - const char* fName; - SkTypeface::Style fStyle; -} gFaces[] = { - { NULL, SkTypeface::kNormal }, - { NULL, SkTypeface::kBold }, - { "serif", SkTypeface::kNormal }, - { "serif", SkTypeface::kBold }, - { "serif", SkTypeface::kItalic }, - { "serif", SkTypeface::kBoldItalic }, - { "monospace", SkTypeface::kNormal } -}; - -static const int gFaceCount = SK_ARRAY_COUNT(gFaces); - -class TypefaceView : public SkView { - SkTypeface* fFaces[gFaceCount]; - -public: - TypefaceView() { - for (int i = 0; i < gFaceCount; i++) { - fFaces[i] = SkTypeface::CreateFromName(gFaces[i].fName, - gFaces[i].fStyle); - } - } - - virtual ~TypefaceView() { - for (int i = 0; i < gFaceCount; i++) { - fFaces[i]->safeUnref(); - } - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Typefaces"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - SkPaint paint; - paint.setAntiAlias(true); - paint.setTextSize(SkIntToScalar(30)); - - const char* text = "Hamburgefons"; - const size_t textLen = strlen(text); - - SkScalar x = SkIntToScalar(10); - SkScalar dy = paint.getFontMetrics(NULL); - SkScalar y = dy; - - for (int i = 0; i < gFaceCount; i++) { - paint.setTypeface(fFaces[i]); - canvas->drawText(text, textLen, x, y, paint); - y += dy; - } - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new TypefaceView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleVertices.cpp b/samplecode/SampleVertices.cpp deleted file mode 100644 index 637c661..0000000 --- a/samplecode/SampleVertices.cpp +++ /dev/null @@ -1,278 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkPath.h" -#include "SkPorterDuff.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkXfermode.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" - -#include "SkImageRef.h" -#include "SkOSFile.h" -#include "SkStream.h" -#include "SkNinePatch.h" - -void setup_vertexbug(SkPoint verts[], SkPoint texs[], uint16_t index[]); - -static void drawbug(SkCanvas* canvas, SkScalar scale) { - SkBitmap bm, bm2; - - SkImageDecoder::DecodeFile("/skimages/btn_default_normal.9.png", &bm); - SkPaint paint; - - SkIRect subset; - subset.set(1, 1, bm.width() - 1, bm.height() - 1); - bm.extractSubset(&bm2, subset); - -#if 0 - SkPoint verts[16], texs[16]; - uint16_t index[54]; - - SkShader* s = SkShader::CreateBitmapShader(bm2, SkShader::kClamp_TileMode, - SkShader::kClamp_TileMode); - paint.setShader(s)->unref(); - - setup_vertexbug(verts, texs, index); - int indexCount = 6; // 54 - canvas->drawVertices(SkCanvas::kTriangles_VertexMode, 16, verts, texs, - NULL, NULL, &index[6], indexCount, paint); - -#if 0 - paint.setShader(NULL); - canvas->drawVertices(SkCanvas::kTriangles_VertexMode, 16, verts, NULL, - NULL, NULL, index, indexCount, paint); -#endif -#else - SkRect dst; - SkIRect margin; - - dst.set(SkIntToScalar(10), SkIntToScalar(10), - SkIntToScalar(100) + scale, - SkIntToScalar(40) + scale); - margin.set(9, 9, 9, 9); - SkNinePatch::DrawNine(canvas, dst, bm2, margin, NULL); -#endif -} - -static SkShader* make_shader0(SkIPoint* size) { - SkBitmap bm; - - SkImageDecoder::DecodeFile("/skimages/logo.gif", &bm); - size->set(bm.width(), bm.height()); - return SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode, - SkShader::kClamp_TileMode); -} - -static SkShader* make_shader1(const SkIPoint& size) { - SkPoint pts[] = { 0, 0, SkIntToScalar(size.fX), SkIntToScalar(size.fY) }; - SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED }; - return SkGradientShader::CreateLinear(pts, colors, NULL, - SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode, NULL); -} - -class VerticesView : public SkView { - SkShader* fShader0; - SkShader* fShader1; - -public: - VerticesView() { - SkIPoint size; - - fShader0 = make_shader0(&size); - fShader1 = make_shader1(size); - - make_strip(&fRecs[0], size.fX, size.fY); - make_fan(&fRecs[1], size.fX, size.fY); - make_tris(&fRecs[2]); - - fScale = SK_Scalar1; - } - - virtual ~VerticesView() { - fShader0->safeUnref(); - fShader1->safeUnref(); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) - { - SkString str("Vertices"); - SampleCode::TitleR(evt, str.c_str()); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorGRAY); - } - - SkScalar fScale; - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - -#if 1 - canvas->drawColor(SK_ColorWHITE); - canvas->translate(SK_Scalar1/2, SkIntToScalar(15) + SK_Scalar1/2); - canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); - drawbug(canvas, fScale); - fScale += SK_Scalar1/93; - this->inval(NULL); - return; -#endif - - SkPaint paint; - paint.setDither(true); - paint.setFilterBitmap(true); - - for (int i = 0; i < SK_ARRAY_COUNT(fRecs); i++) { - canvas->save(); - - paint.setShader(NULL); - canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount, - fRecs[i].fVerts, fRecs[i].fTexs, - NULL, NULL, NULL, 0, paint); - - canvas->translate(SkIntToScalar(250), 0); - - paint.setShader(fShader0); - canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount, - fRecs[i].fVerts, fRecs[i].fTexs, - NULL, NULL, NULL, 0, paint); - - canvas->translate(SkIntToScalar(250), 0); - - paint.setShader(fShader1); - canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount, - fRecs[i].fVerts, fRecs[i].fTexs, - NULL, NULL, NULL, 0, paint); - canvas->restore(); - - canvas->translate(0, SkIntToScalar(250)); - } - } - - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { - return new Click(this); - } - - virtual bool onClick(Click* click) { - // fCurrX = click->fICurr.fX; - // fCurrY = click->fICurr.fY; - this->inval(NULL); - return true; - } - -private: - struct Rec { - SkCanvas::VertexMode fMode; - int fCount; - SkPoint* fVerts; - SkPoint* fTexs; - - Rec() : fCount(0), fVerts(NULL), fTexs(NULL) {} - ~Rec() { delete[] fVerts; delete[] fTexs; } - }; - - void make_tris(Rec* rec) { - int n = 10; - SkRandom rand; - - rec->fMode = SkCanvas::kTriangles_VertexMode; - rec->fCount = n * 3; - rec->fVerts = new SkPoint[rec->fCount]; - - for (int i = 0; i < n; i++) { - SkPoint* v = &rec->fVerts[i*3]; - for (int j = 0; j < 3; j++) { - v[j].set(rand.nextUScalar1() * 250, rand.nextUScalar1() * 250); - } - } - } - - void make_fan(Rec* rec, int texWidth, int texHeight) { - const SkScalar tx = SkIntToScalar(texWidth); - const SkScalar ty = SkIntToScalar(texHeight); - const int n = 24; - - rec->fMode = SkCanvas::kTriangleFan_VertexMode; - rec->fCount = n + 2; - rec->fVerts = new SkPoint[rec->fCount]; - rec->fTexs = new SkPoint[rec->fCount]; - - SkPoint* v = rec->fVerts; - SkPoint* t = rec->fTexs; - - v[0].set(0, 0); - t[0].set(0, 0); - for (int i = 0; i < n; i++) { - SkScalar cos; - SkScalar sin = SkScalarSinCos(SK_ScalarPI * 2 * i / n, &cos); - v[i+1].set(cos, sin); - t[i+1].set(i*tx/n, ty); - } - v[n+1] = v[1]; - t[n+1].set(tx, ty); - - SkMatrix m; - m.setScale(SkIntToScalar(100), SkIntToScalar(100)); - m.postTranslate(SkIntToScalar(110), SkIntToScalar(110)); - m.mapPoints(v, rec->fCount); - } - - void make_strip(Rec* rec, int texWidth, int texHeight) { - const SkScalar tx = SkIntToScalar(texWidth); - const SkScalar ty = SkIntToScalar(texHeight); - const int n = 24; - - rec->fMode = SkCanvas::kTriangleStrip_VertexMode; - rec->fCount = 2 * (n + 1); - rec->fVerts = new SkPoint[rec->fCount]; - rec->fTexs = new SkPoint[rec->fCount]; - - SkPoint* v = rec->fVerts; - SkPoint* t = rec->fTexs; - - for (int i = 0; i < n; i++) { - SkScalar cos; - SkScalar sin = SkScalarSinCos(SK_ScalarPI * 2 * i / n, &cos); - v[i*2 + 0].set(cos/2, sin/2); - v[i*2 + 1].set(cos, sin); - - t[i*2 + 0].set(tx * i / n, ty); - t[i*2 + 1].set(tx * i / n, 0); - } - v[2*n + 0] = v[0]; - v[2*n + 1] = v[1]; - - t[2*n + 0].set(tx, ty); - t[2*n + 1].set(tx, 0); - - SkMatrix m; - m.setScale(SkIntToScalar(100), SkIntToScalar(100)); - m.postTranslate(SkIntToScalar(110), SkIntToScalar(110)); - m.mapPoints(v, rec->fCount); - } - - Rec fRecs[3]; - - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new VerticesView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/SampleXfermodes.cpp b/samplecode/SampleXfermodes.cpp deleted file mode 100644 index 1dbfc95..0000000 --- a/samplecode/SampleXfermodes.cpp +++ /dev/null @@ -1,265 +0,0 @@ -#include "SampleCode.h" -#include "SkView.h" -#include "SkCanvas.h" -#include "Sk64.h" -#include "SkCornerPathEffect.h" -#include "SkGradientShader.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" -#include "SkKernel33MaskFilter.h" -#include "SkPath.h" -#include "SkRandom.h" -#include "SkRegion.h" -#include "SkShader.h" -#include "SkUtils.h" -#include "SkColorPriv.h" -#include "SkColorFilter.h" -#include "SkTime.h" -#include "SkTypeface.h" -#include "SkXfermode.h" - -#include "SkStream.h" -#include "SkXMLParser.h" -#include "SkColorPriv.h" -#include "SkImageDecoder.h" - -static int newscale(U8CPU a, U8CPU b, int shift) { - unsigned prod = a * b + (1 << (shift - 1)); - return (prod + (prod >> shift)) >> shift; -} - -static void test_srcover565(SkCanvas* canvas) { - const int width = 32; - SkBitmap bm1, bm2, bm3; - bm1.setConfig(SkBitmap::kRGB_565_Config, width, 256); bm1.allocPixels(NULL); - bm2.setConfig(SkBitmap::kRGB_565_Config, width, 256); bm2.allocPixels(NULL); - bm3.setConfig(SkBitmap::kRGB_565_Config, width, 256); bm3.allocPixels(NULL); - - int rgb = 0x18; - int r = rgb >> 3; - int g = rgb >> 2; - uint16_t dst = SkPackRGB16(r, g, r); - for (int alpha = 0; alpha <= 255; alpha++) { - SkPMColor pm = SkPreMultiplyARGB(alpha, rgb, rgb, rgb); - uint16_t newdst = SkSrcOver32To16(pm, dst); - sk_memset16(bm1.getAddr16(0, alpha), newdst, bm1.width()); - - int ia = 255 - alpha; - int iscale = SkAlpha255To256(ia); - int dr = (SkGetPackedR32(pm) + (r * iscale >> 5)) >> 3; - int dg = (SkGetPackedG32(pm) + (g * iscale >> 6)) >> 2; - - sk_memset16(bm2.getAddr16(0, alpha), SkPackRGB16(dr, dg, dr), bm2.width()); - - int dr2 = (SkMulDiv255Round(alpha, rgb) + newscale(r, ia, 5)) >> 3; - int dg2 = (SkMulDiv255Round(alpha, rgb) + newscale(g, ia, 6)) >> 2; - - sk_memset16(bm3.getAddr16(0, alpha), SkPackRGB16(dr2, dg2, dr2), bm3.width()); - -// if (mr != dr || mg != dg) - { -// SkDebugf("[%d] macro [%d %d] inline [%d %d] new [%d %d]\n", alpha, mr, mg, dr, dg, dr2, dg2); - } - } - - SkScalar dx = SkIntToScalar(width+4); - - canvas->drawBitmap(bm1, 0, 0, NULL); canvas->translate(dx, 0); - canvas->drawBitmap(bm2, 0, 0, NULL); canvas->translate(dx, 0); - canvas->drawBitmap(bm3, 0, 0, NULL); canvas->translate(dx, 0); - - SkRect rect = { 0, 0, SkIntToScalar(bm1.width()), SkIntToScalar(bm1.height()) }; - SkPaint p; - p.setARGB(0xFF, rgb, rgb, rgb); - canvas->drawRect(rect, p); -} - -static void make_bitmaps(int w, int h, SkBitmap* src, SkBitmap* dst) { - src->setConfig(SkBitmap::kARGB_8888_Config, w, h); - src->allocPixels(); - src->eraseColor(0); - - SkCanvas c(*src); - SkPaint p; - SkRect r; - SkScalar ww = SkIntToScalar(w); - SkScalar hh = SkIntToScalar(h); - - p.setAntiAlias(true); - p.setColor(0xFFFFCC44); - r.set(0, 0, ww*3/4, hh*3/4); - c.drawOval(r, p); - - dst->setConfig(SkBitmap::kARGB_8888_Config, w, h); - dst->allocPixels(); - dst->eraseColor(0); - c.setBitmapDevice(*dst); - - p.setColor(0xFF66AAFF); - r.set(ww/3, hh/3, ww*19/20, hh*19/20); - c.drawRect(r, p); -} - -static uint16_t gBG[] = { 0xFFFF, 0xCCCF, 0xCCCF, 0xFFFF }; - -class XfermodesView : public SkView { - SkBitmap fBitmap; - SkBitmap fBG; - SkBitmap fSrcB, fDstB; - - void draw_mode(SkCanvas* canvas, SkXfermode* mode, int alpha) { - SkPaint p; - - canvas->drawBitmap(fSrcB, 0, 0, &p); - p.setAlpha(alpha); - p.setXfermode(mode); - canvas->drawBitmap(fDstB, 0, 0, &p); - } - -public: - XfermodesView() { - const int W = 64; - const int H = 64; - - fBitmap.setConfig(SkBitmap::kARGB_8888_Config, W, H); - fBitmap.allocPixels(); - - fBG.setConfig(SkBitmap::kARGB_4444_Config, 2, 2, 4); - fBG.setPixels(gBG); - fBG.setIsOpaque(true); - - make_bitmaps(W, H, &fSrcB, &fDstB); - } - -protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { - if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "Xfermodes"); - return true; - } - return this->INHERITED::onQuery(evt); - } - - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - return; - SkShader* s = SkShader::CreateBitmapShader(fBG, - SkShader::kRepeat_TileMode, - SkShader::kRepeat_TileMode); - SkPaint p; - SkMatrix m; - - p.setShader(s)->unref(); - m.setScale(SkIntToScalar(8), SkIntToScalar(8)); - s->setLocalMatrix(m); - canvas->drawPaint(p); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - - if (false) { - test_srcover565(canvas); - } - - if (false) { - SkPaint paint; - paint.setFlags(0x43); - paint.setTextSize(SkIntToScalar(128)); - SkMatrix matrix; - matrix.reset(); - matrix.set(0, 0x0019d049); - matrix.set(2, 0x712cf400); - matrix.set(4, 0x0019c96f); - matrix.set(5, 0xF8d76598); - canvas->concat(matrix); - canvas->drawText("HamburgefonsHamburgefonsHamburgefonsHamburgefons", - 48, 0, 0, paint); - return; - } - - const struct { - SkPorterDuff::Mode fMode; - const char* fLabel; - } gModes[] = { - { SkPorterDuff::kClear_Mode, "Clear" }, - { SkPorterDuff::kSrc_Mode, "Src" }, - { SkPorterDuff::kDst_Mode, "Dst" }, - { SkPorterDuff::kSrcOver_Mode, "SrcOver" }, - { SkPorterDuff::kDstOver_Mode, "DstOver" }, - { SkPorterDuff::kSrcIn_Mode, "SrcIn" }, - { SkPorterDuff::kDstIn_Mode, "DstIn" }, - { SkPorterDuff::kSrcOut_Mode, "SrcOut" }, - { SkPorterDuff::kDstOut_Mode, "DstOut" }, - { SkPorterDuff::kSrcATop_Mode, "SrcATop" }, - { SkPorterDuff::kDstATop_Mode, "DstATop" }, - { SkPorterDuff::kXor_Mode, "Xor" }, - { SkPorterDuff::kDarken_Mode, "Darken" }, - { SkPorterDuff::kLighten_Mode, "Lighten" }, - { SkPorterDuff::kMultiply_Mode, "Multiply" }, - { SkPorterDuff::kScreen_Mode, "Screen" } - }; - - canvas->translate(SkIntToScalar(10), SkIntToScalar(20)); - - SkCanvas c(fBitmap); - const SkScalar w = SkIntToScalar(fBitmap.width()); - const SkScalar h = SkIntToScalar(fBitmap.height()); - SkShader* s = SkShader::CreateBitmapShader(fBG, - SkShader::kRepeat_TileMode, - SkShader::kRepeat_TileMode); - SkMatrix m; - m.setScale(SkIntToScalar(6), SkIntToScalar(6)); - s->setLocalMatrix(m); - - SkPaint labelP; - labelP.setAntiAlias(true); - labelP.setTextAlign(SkPaint::kCenter_Align); - - SkScalar x0 = 0; - for (int twice = 0; twice < 2; twice++) { - SkScalar x = x0, y = 0; - for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) { - SkXfermode* mode = SkPorterDuff::CreateXfermode(gModes[i].fMode); - - fBitmap.eraseColor(0); - draw_mode(&c, mode, twice ? 0x88 : 0xFF); - mode->safeUnref(); - - SkPaint p; - SkRect r; - r.set(x, y, x+w, y+h); - r.inset(-SK_ScalarHalf, -SK_ScalarHalf); - p.setStyle(SkPaint::kStroke_Style); - canvas->drawRect(r, p); - p.setStyle(SkPaint::kFill_Style); - p.setShader(s); - r.inset(SK_ScalarHalf, SK_ScalarHalf); - canvas->drawRect(r, p); - - canvas->drawBitmap(fBitmap, x, y, NULL); - - canvas->drawText(gModes[i].fLabel, strlen(gModes[i].fLabel), - x + w/2, y - labelP.getTextSize()/2, labelP); - - x += w + SkIntToScalar(10); - if ((i & 3) == 3) { - x = x0; - y += h + SkIntToScalar(30); - } - } - x0 += SkIntToScalar(330); - } - s->unref(); - } - -private: - typedef SkView INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static SkView* MyFactory() { return new XfermodesView; } -static SkViewRegister reg(MyFactory); - diff --git a/samplecode/vertexdump.cpp b/samplecode/vertexdump.cpp deleted file mode 100644 index c124ad8..0000000 --- a/samplecode/vertexdump.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "SkPoint.h" - -void setup_vertexbug(SkPoint verts[], SkPoint texs[], uint16_t index[]); - -void setup_vertexbug(SkPoint verts[], SkPoint texs[], uint16_t index[]) { - verts[0].set(SkFloatToScalar(107), SkFloatToScalar(189)); - texs[0].set(SkFloatToScalar(0), SkFloatToScalar(0)); - verts[1].set(SkFloatToScalar(116), SkFloatToScalar(189)); - texs[1].set(SkFloatToScalar(9), SkFloatToScalar(0)); - verts[2].set(SkFloatToScalar(203), SkFloatToScalar(189)); - texs[2].set(SkFloatToScalar(35), SkFloatToScalar(0)); - verts[3].set(SkFloatToScalar(212), SkFloatToScalar(189)); - texs[3].set(SkFloatToScalar(44), SkFloatToScalar(0)); - verts[4].set(SkFloatToScalar(107), SkFloatToScalar(198)); - texs[4].set(SkFloatToScalar(0), SkFloatToScalar(9)); - verts[5].set(SkFloatToScalar(116), SkFloatToScalar(198)); - texs[5].set(SkFloatToScalar(9), SkFloatToScalar(9)); - verts[6].set(SkFloatToScalar(203), SkFloatToScalar(198)); - texs[6].set(SkFloatToScalar(35), SkFloatToScalar(9)); - verts[7].set(SkFloatToScalar(212), SkFloatToScalar(198)); - texs[7].set(SkFloatToScalar(44), SkFloatToScalar(9)); - verts[8].set(SkFloatToScalar(107), SkFloatToScalar(224)); - texs[8].set(SkFloatToScalar(0), SkFloatToScalar(39)); - verts[9].set(SkFloatToScalar(116), SkFloatToScalar(224)); - texs[9].set(SkFloatToScalar(9), SkFloatToScalar(39)); - verts[10].set(SkFloatToScalar(203), SkFloatToScalar(224)); - texs[10].set(SkFloatToScalar(35), SkFloatToScalar(39)); - verts[11].set(SkFloatToScalar(212), SkFloatToScalar(224)); - texs[11].set(SkFloatToScalar(44), SkFloatToScalar(39)); - verts[12].set(SkFloatToScalar(107), SkFloatToScalar(233)); - texs[12].set(SkFloatToScalar(0), SkFloatToScalar(48)); - verts[13].set(SkFloatToScalar(116), SkFloatToScalar(233)); - texs[13].set(SkFloatToScalar(9), SkFloatToScalar(48)); - verts[14].set(SkFloatToScalar(203), SkFloatToScalar(233)); - texs[14].set(SkFloatToScalar(35), SkFloatToScalar(48)); - verts[15].set(SkFloatToScalar(212), SkFloatToScalar(233)); - texs[15].set(SkFloatToScalar(44), SkFloatToScalar(48)); - index[0] = 0; index[1] = 5; index[2] = 1; - index[3] = 0; index[4] = 4; index[5] = 5; -#if 0 - index[6] = 1; index[7] = 6; index[8] = 2; -#else - index[6] = 6; index[7] = 2; index[8] = 1; -#endif - index[9] = 1; index[10] = 5; index[11] = 6; - index[12] = 2; - index[13] = 7; - index[14] = 3; - index[15] = 2; - index[16] = 6; - index[17] = 7; - index[18] = 4; - index[19] = 9; - index[20] = 5; - index[21] = 4; - index[22] = 8; - index[23] = 9; - index[24] = 5; - index[25] = 10; - index[26] = 6; - index[27] = 5; - index[28] = 9; - index[29] = 10; - index[30] = 6; - index[31] = 11; - index[32] = 7; - index[33] = 6; - index[34] = 10; - index[35] = 11; - index[36] = 8; - index[37] = 13; - index[38] = 9; - index[39] = 8; - index[40] = 12; - index[41] = 13; - index[42] = 9; - index[43] = 14; - index[44] = 10; - index[45] = 9; - index[46] = 13; - index[47] = 14; - index[48] = 10; - index[49] = 15; - index[50] = 11; - index[51] = 10; - index[52] = 14; - index[53] = 15; -} diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 1d3263f..bc981f9 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -2305,7 +2305,15 @@ static bool compute_bounds(const SkPath& devPath, const SkIRect* clipBounds, if (clipBounds && !clipBounds->contains(*bounds)) { SkIRect tmp = *bounds; (void)tmp.intersect(*clipBounds); - tmp.inset(-margin.fX, -margin.fY); + // Ugh. Guard against gigantic margins from wacky filters. Without this + // check we can request arbitrary amounts of slop beyond our visible + // clip, and bring down the renderer (at least on finite RAM machines + // like handsets, etc.). Need to balance this invented value between + // quality of large filters like blurs, and the corresponding memory + // requests. + static const int MAX_MARGIN = 128; + tmp.inset(-SkMin32(margin.fX, MAX_MARGIN), + -SkMin32(margin.fY, MAX_MARGIN)); (void)bounds->intersect(tmp); } diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index bbcc130..8f84cbb 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -95,7 +95,7 @@ SkScalerContext::SkScalerContext(const SkDescriptor* desc) } fBaseGlyphCount = 0; - fAuxScalerContext = NULL; + fNextContext = NULL; const Rec* rec = (const Rec*)desc->findEntry(kRec_SkDescriptorTag, NULL); SkASSERT(rec); @@ -121,78 +121,97 @@ SkScalerContext::SkScalerContext(const SkDescriptor* desc) } SkScalerContext::~SkScalerContext() { + SkDELETE(fNextContext); + fPathEffect->safeUnref(); fMaskFilter->safeUnref(); fRasterizer->safeUnref(); - - SkDELETE(fAuxScalerContext); } -SkScalerContext* SkScalerContext::loadAuxContext() const { - if (NULL == fAuxScalerContext) { - fAuxScalerContext = SkFontHost::CreateFallbackScalerContext(fRec); - if (NULL != fAuxScalerContext) { - fAuxScalerContext->setBaseGlyphCount(this->getGlyphCount()); - } +static SkScalerContext* allocNextContext(const SkScalerContext::Rec& rec) { + // fonthost will determine the next possible font to search, based + // on the current font in fRec. It will return NULL if ctx is our + // last font that can be searched (i.e. ultimate fallback font) + uint32_t newFontID = SkFontHost::NextLogicalFont(rec.fFontID); + if (0 == newFontID) { + return NULL; } - return fAuxScalerContext; -} -#ifdef TRACK_MISSING_CHARS - static uint8_t gMissingChars[1 << 13]; -#endif + SkAutoDescriptor ad(sizeof(rec) + SkDescriptor::ComputeOverhead(1)); + SkDescriptor* desc = ad.getDesc(); -uint16_t SkScalerContext::charToGlyphID(SkUnichar uni) { - unsigned glyphID = this->generateCharToGlyph(uni); - - if (0 == glyphID) { // try auxcontext - SkScalerContext* ctx = this->loadAuxContext(); - if (NULL != ctx) { - glyphID = ctx->generateCharToGlyph(uni); - if (0 != glyphID) { // only fiddle with it if its not missing - glyphID += this->getGlyphCount(); - if (glyphID > 0xFFFF) { - glyphID = 0; - } - } + desc->init(); + SkScalerContext::Rec* newRec = + (SkScalerContext::Rec*)desc->addEntry(kRec_SkDescriptorTag, + sizeof(rec), &rec); + newRec->fFontID = newFontID; + desc->computeChecksum(); + + return SkFontHost::CreateScalerContext(desc); +} + +/* Return the next context, creating it if its not already created, but return + NULL if the fonthost says there are no more fonts to fallback to. + */ +SkScalerContext* SkScalerContext::getNextContext() { + SkScalerContext* next = fNextContext; + // if next is null, then either it isn't cached yet, or we're at the + // end of our possible chain + if (NULL == next) { + next = allocNextContext(fRec); + if (NULL == next) { + return NULL; } + // next's base is our base + our local count + next->setBaseGlyphCount(fBaseGlyphCount + this->getGlyphCount()); + // cache the answer + fNextContext = next; } -#ifdef TRACK_MISSING_CHARS - if (0 == glyphID) { - bool announce = false; - if (uni > 0xFFFF) { // we don't record these - announce = true; - } else { - unsigned index = uni >> 3; - unsigned mask = 1 << (uni & 7); - SkASSERT(index < SK_ARRAY_COUNT(gMissingChars)); - if ((gMissingChars[index] & mask) == 0) { - gMissingChars[index] |= mask; - announce = true; - } + return next; +} + +SkScalerContext* SkScalerContext::getGlyphContext(const SkGlyph& glyph) { + unsigned glyphID = glyph.getGlyphID(); + SkScalerContext* ctx = this; + for (;;) { + unsigned count = ctx->getGlyphCount(); + if (glyphID < count) { + break; } - if (announce) { - printf(">>> MISSING CHAR <<< 0x%04X\n", uni); + glyphID -= count; + ctx = ctx->getNextContext(); + if (NULL == ctx) { + SkDebugf("--- no context for glyph %x\n", glyph.getGlyphID()); + // just return the original context (this) + return this; } } -#endif - return SkToU16(glyphID); + return ctx; } -/* Internal routine to resolve auxContextID into a real context. - Only makes sense to call once the glyph has been given a - valid auxGlyphID. -*/ -SkScalerContext* SkScalerContext::getGlyphContext(const SkGlyph& glyph) const { - SkScalerContext* ctx = const_cast<SkScalerContext*>(this); - - if (glyph.getGlyphID() >= this->getGlyphCount()) { - ctx = this->loadAuxContext(); - if (NULL == ctx) { // if no aux, just return us - ctx = const_cast<SkScalerContext*>(this); +/* This loops through all available fallback contexts (if needed) until it + finds some context that can handle the unichar. If all fail, returns 0 + */ +uint16_t SkScalerContext::charToGlyphID(SkUnichar uni) { + SkScalerContext* ctx = this; + unsigned glyphID; + for (;;) { + glyphID = ctx->generateCharToGlyph(uni); + if (glyphID) { + break; // found it + } + ctx = ctx->getNextContext(); + if (NULL == ctx) { + return 0; // no more contexts, return missing glyph } } - return ctx; + // add the ctx's base, making glyphID unique for chain of contexts + glyphID += ctx->fBaseGlyphCount; + // check for overflow of 16bits, since our glyphID cannot exceed that + if (glyphID > 0xFFFF) { + glyphID = 0; + } + return SkToU16(glyphID); } void SkScalerContext::getAdvance(SkGlyph* glyph) { diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp index 9cdeeaa..422d060 100644 --- a/src/core/SkScan_AntiPath.cpp +++ b/src/core/SkScan_AntiPath.cpp @@ -335,8 +335,13 @@ void MaskSuperBlitter::blitH(int x, int y, int width) /////////////////////////////////////////////////////////////////////////////// -static int overflows_short(int value) { - return value - (short)value; +/* Returns non-zero if (value << shift) overflows a short, which would mean + we could not shift it up and then convert to SkFixed. + i.e. is x expressible as signed (16-shift) bits? + */ +static int overflows_short_shift(int value, int shift) { + const int s = 16 + shift; + return (value << s >> s) - value; } void SkScan::AntiFillPath(const SkPath& path, const SkRegion& clip, @@ -354,13 +359,13 @@ void SkScan::AntiFillPath(const SkPath& path, const SkRegion& clip, return; } - if (overflows_short(ir.fLeft << SHIFT) || - overflows_short(ir.fRight << SHIFT) || - overflows_short(ir.width() << SHIFT) || - overflows_short(ir.fTop << SHIFT) || - overflows_short(ir.fBottom << SHIFT) || - overflows_short(ir.height() << SHIFT)) { - // can't supersample, try drawing w/o antialiasing + // use bit-or since we expect all to pass, so no need to go slower with + // a short-circuiting logical-or + if (overflows_short_shift(ir.fLeft, SHIFT) | + overflows_short_shift(ir.fRight, SHIFT) | + overflows_short_shift(ir.fTop, SHIFT) | + overflows_short_shift(ir.fBottom, SHIFT)) { + // can't supersample, so draw w/o antialiasing SkScan::FillPath(path, clip, blitter); return; } diff --git a/src/core/SkScan_Antihair.cpp b/src/core/SkScan_Antihair.cpp index 04e4690..3344698 100644 --- a/src/core/SkScan_Antihair.cpp +++ b/src/core/SkScan_Antihair.cpp @@ -212,8 +212,14 @@ static void do_anti_hairline(SkFDot6 x0, SkFDot6 y0, SkFDot6 x1, SkFDot6 y1, if (SkAbs32(x1 - x0) > SkIntToFDot6(511) || SkAbs32(y1 - y0) > SkIntToFDot6(511)) { - int hx = (x0 + x1) >> 1; - int hy = (y0 + y1) >> 1; + /* instead of (x0 + x1) >> 1, we shift each separately. This is less + precise, but avoids overflowing the intermediate result if the + values are huge. A better fix might be to clip the original pts + directly (i.e. do the divide), so we don't spend time subdividing + huge lines at all. + */ + int hx = (x0 >> 1) + (x1 >> 1); + int hy = (y0 >> 1) + (y1 >> 1); do_anti_hairline(x0, y0, hx, hy, clip, blitter); do_anti_hairline(hx, hy, x1, y1, clip, blitter); return; diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index 2db60a5..b74cd99 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -81,11 +81,19 @@ SkMask::Format SkBlurMaskFilterImpl::getFormat() bool SkBlurMaskFilterImpl::filterMask(SkMask* dst, const SkMask& src, const SkMatrix& matrix, SkIPoint* margin) { SkScalar radius = matrix.mapRadius(fRadius); + // To avoid unseemly allocation requests (esp. for finite platforms like + // handset) we limit the radius so something manageable. (as opposed to + // a request like 10,000) + static const SkScalar MAX_RADIUS = SkIntToScalar(128); + radius = SkMinScalar(radius, MAX_RADIUS); if (SkBlurMask::Blur(dst, src, radius, (SkBlurMask::Style)fBlurStyle)) { - if (margin) + if (margin) { + // we need to integralize radius for our margin, so take the ceil + // just to be safe. margin->set(SkScalarCeil(radius), SkScalarCeil(radius)); + } return true; } return false; diff --git a/src/images/SkImageRef.cpp b/src/images/SkImageRef.cpp index 90c37b6..0865c88 100644 --- a/src/images/SkImageRef.cpp +++ b/src/images/SkImageRef.cpp @@ -15,12 +15,12 @@ SkImageRef::SkImageRef(SkStream* stream, SkBitmap::Config config, int sampleSize) : SkPixelRef(&gImageRefMutex), fErrorInDecoding(false) { SkASSERT(stream); - SkASSERT(1 == stream->getRefCnt()); - + stream->ref(); fStream = stream; fConfig = config; fSampleSize = sampleSize; fPrev = fNext = NULL; + fFactory = NULL; #ifdef DUMP_IMAGEREF_LIFECYCLE SkDebugf("add ImageRef %p [%d] data=%d\n", @@ -36,7 +36,8 @@ SkImageRef::~SkImageRef() { this, fConfig, (int)fStream->getLength()); #endif - delete fStream; + fStream->unref(); + fFactory->safeUnref(); } bool SkImageRef::getInfo(SkBitmap* bitmap) { @@ -53,6 +54,12 @@ bool SkImageRef::getInfo(SkBitmap* bitmap) { return true; } +SkImageDecoderFactory* SkImageRef::setDecoderFactory( + SkImageDecoderFactory* fact) { + SkRefCnt_SafeAssign(fFactory, fact); + return fact; +} + /////////////////////////////////////////////////////////////////////////////// bool SkImageRef::onDecode(SkImageDecoder* codec, SkStream* stream, @@ -85,8 +92,14 @@ bool SkImageRef::prepareBitmap(SkImageDecoder::Mode mode) { SkASSERT(fBitmap.getPixels() == NULL); fStream->rewind(); - - SkImageDecoder* codec = SkImageDecoder::Factory(fStream); + + SkImageDecoder* codec; + if (fFactory) { + codec = fFactory->newDecoder(fStream); + } else { + codec = SkImageDecoder::Factory(fStream); + } + if (codec) { SkAutoTDelete<SkImageDecoder> ad(codec); diff --git a/src/ports/SkFontHost_android.cpp b/src/ports/SkFontHost_android.cpp index 43bbde3..6ee75dc 100644 --- a/src/ports/SkFontHost_android.cpp +++ b/src/ports/SkFontHost_android.cpp @@ -590,22 +590,14 @@ SkStream* SkFontHost::OpenStream(uint32_t fontID) return stream; } -SkScalerContext* SkFontHost::CreateFallbackScalerContext( - const SkScalerContext::Rec& rec) -{ +uint32_t SkFontHost::NextLogicalFont(uint32_t fontID) { load_system_fonts(); - SkAutoDescriptor ad(sizeof(rec) + SkDescriptor::ComputeOverhead(1)); - SkDescriptor* desc = ad.getDesc(); - - desc->init(); - SkScalerContext::Rec* newRec = - (SkScalerContext::Rec*)desc->addEntry(kRec_SkDescriptorTag, - sizeof(rec), &rec); - newRec->fFontID = gFallBackTypeface->uniqueID(); - desc->computeChecksum(); - - return SkFontHost::CreateScalerContext(desc); + if (gFallBackTypeface->uniqueID() == fontID) { + // no where to go, just return NULL + return 0; + } + return gFallBackTypeface->uniqueID(); } /////////////////////////////////////////////////////////////////////////////// |