explicitly include blurimagefilter include

Try explicitly adding
to fix the bookmaker nightly bot.

R=jcgregorio@google.com,caryclark@google.com

Docs-Preview: https://skia.org/?cl=137421
Bug: skia:6898
Change-Id: Iff27845e6872b885b8494e9fc236f4f05c10c301
Reviewed-on: https://skia-review.googlesource.com/137421
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
This commit is contained in:
Cary Clark 2018-06-25 16:30:08 -04:00 committed by Skia Commit-Bot
parent 536ad2c146
commit 81abc43e6f
6 changed files with 74 additions and 54 deletions

View File

@ -1509,6 +1509,12 @@ Rectangles are blurred by Image_Filter when restore() draws Layer to main
Canvas. Canvas.
## ##
#Height 128 #Height 128
#Function
###$
#include "SkBlurImageFilter.h"
$$$#
##
void draw(SkCanvas* canvas) { void draw(SkCanvas* canvas) {
SkPaint paint, blur; SkPaint paint, blur;
blur.setImageFilter(SkBlurImageFilter::Make(3, 3, nullptr)); blur.setImageFilter(SkBlurImageFilter::Make(3, 3, nullptr));
@ -1558,6 +1564,12 @@ The red rectangle is clipped; it does not fully fit on Layer.
Image_Filter blurs past edge of Layer so red rectangle is blurred on all sides. Image_Filter blurs past edge of Layer so red rectangle is blurred on all sides.
## ##
#Height 128 #Height 128
#Function
###$
#include "SkBlurImageFilter.h"
$$$#
##
void draw(SkCanvas* canvas) { void draw(SkCanvas* canvas) {
SkPaint paint, blur; SkPaint paint, blur;
blur.setImageFilter(SkBlurImageFilter::Make(3, 3, nullptr)); blur.setImageFilter(SkBlurImageFilter::Make(3, 3, nullptr));

View File

@ -3226,6 +3226,11 @@ Mask_Filter.
#Example #Example
#ToDo explain why the two draws are so different ## #ToDo explain why the two draws are so different ##
#Function
###$
#include "SkBlurImageFilter.h"
$$$#
##
void draw(SkCanvas* canvas) { void draw(SkCanvas* canvas) {
SkPaint paint; SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style); paint.setStyle(SkPaint::kStroke_Style);
@ -3252,6 +3257,11 @@ Mask_Filter.
#Return Image_Filter if previously set, nullptr otherwise ## #Return Image_Filter if previously set, nullptr otherwise ##
#Example #Example
#Function
###$
#include "SkBlurImageFilter.h"
$$$#
##
void draw(SkCanvas* canvas) { void draw(SkCanvas* canvas) {
SkPaint paint; SkPaint paint;
SkDebugf("nullptr %c= image filter\n", paint.getImageFilter() ? '!' : '='); SkDebugf("nullptr %c= image filter\n", paint.getImageFilter() ? '!' : '=');

View File

@ -2100,7 +2100,7 @@ depth of saved stack
### Example ### Example
<div><fiddle-embed name="1a025d6018f64140af2dc36acad59008"><div>Rectangles are blurred by <a href='undocumented#Image_Filter'>Image Filter</a> when <a href='#SkCanvas_restore'>restore</a> draws <a href='#Layer'>Layer</a> to main <div><fiddle-embed name="42318b18d403e17e07a541652da91ee2"><div>Rectangles are blurred by <a href='undocumented#Image_Filter'>Image Filter</a> when <a href='#SkCanvas_restore'>restore</a> draws <a href='#Layer'>Layer</a> to main
<a href='#Canvas'>Canvas</a>. <a href='#Canvas'>Canvas</a>.
</div></fiddle-embed></div> </div></fiddle-embed></div>
@ -2149,7 +2149,7 @@ depth of saved stack
### Example ### Example
<div><fiddle-embed name="5b59231feae0c09cb1ab6a292229d7a4"><div>Rectangles are blurred by <a href='undocumented#Image_Filter'>Image Filter</a> when <a href='#SkCanvas_restore'>restore</a> draws <a href='#Layer'>Layer</a> to main <a href='#Canvas'>Canvas</a>. <div><fiddle-embed name="a17aec3aa4909527be039e26a7eda694"><div>Rectangles are blurred by <a href='undocumented#Image_Filter'>Image Filter</a> when <a href='#SkCanvas_restore'>restore</a> draws <a href='#Layer'>Layer</a> to main <a href='#Canvas'>Canvas</a>.
The red rectangle is clipped; it does not fully fit on <a href='#Layer'>Layer</a>. The red rectangle is clipped; it does not fully fit on <a href='#Layer'>Layer</a>.
<a href='undocumented#Image_Filter'>Image Filter</a> blurs past edge of <a href='#Layer'>Layer</a> so red rectangle is blurred on all sides. <a href='undocumented#Image_Filter'>Image Filter</a> blurs past edge of <a href='#Layer'>Layer</a> so red rectangle is blurred on all sides.
</div></fiddle-embed></div> </div></fiddle-embed></div>

View File

@ -4034,7 +4034,7 @@ implementation.
</pre> </pre>
Returns <a href='undocumented#Typeface'>Typeface</a> if set, or nullptr. Returns <a href='undocumented#Typeface'>Typeface</a> if set, or nullptr.
Increments <a href='undocumented#Typeface'>Typeface</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. Does not alter <a href='undocumented#Typeface'>Typeface</a> <a href='undocumented#Reference_Count'>Reference Count</a>.
### Return Value ### Return Value
@ -4120,7 +4120,7 @@ can operate on all channels of <a href='SkColor_Reference#Color'>Color</a>, whil
### Example ### Example
<div><fiddle-embed name="250e45c5935d54eac6aca775d1fe3475"></fiddle-embed></div> <div><fiddle-embed name="ece04ee3d3761e3425f37c8f06f054c1"></fiddle-embed></div>
<a name='SkPaint_getImageFilter'></a> <a name='SkPaint_getImageFilter'></a>
## getImageFilter ## getImageFilter
@ -4138,7 +4138,7 @@ Does not alter <a href='undocumented#Image_Filter'>Image Filter</a> <a href='und
### Example ### Example
<div><fiddle-embed name="7b8118ff57fcb84e6bc82380d155b62e"> <div><fiddle-embed name="c11f8eaa1dd149bc18db21e23ce26904">
#### Example Output #### Example Output

View File

@ -69,6 +69,13 @@
"file": "SkBitmap_Reference", "file": "SkBitmap_Reference",
"name": "SkBitmap::colorSpace", "name": "SkBitmap::colorSpace",
"stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n" "stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n"
},
"SkBitmap_colorType": {
"code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\"};\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::MakeA8(16, 32));\n SkDebugf(\"color type: k\" \"%s\" \"_SkColorType\\n\", colors[bitmap.colorType()]);\n}",
"hash": "ceb77fab7326b57822a147b04aa0960e",
"file": "SkBitmap_Reference",
"name": "SkBitmap::colorType",
"stdout": "color type: kAlpha_8_SkColorType\\n"
}, },
"SkBitmap_computeByteSize": { "SkBitmap_computeByteSize": {
"code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n for (int width : { 1, 1000, 1000000 } ) {\n for (int height: { 1, 1000, 1000000 } ) {\n SkImageInfo imageInfo = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType);\n bitmap.setInfo(imageInfo, width * 5);\n SkDebugf(\"width: %7d height: %7d computeByteSize: %13lld\\n\", width, height,\n bitmap.computeByteSize());\n }\n }\n}", "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n for (int width : { 1, 1000, 1000000 } ) {\n for (int height: { 1, 1000, 1000000 } ) {\n SkImageInfo imageInfo = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType);\n bitmap.setInfo(imageInfo, width * 5);\n SkDebugf(\"width: %7d height: %7d computeByteSize: %13lld\\n\", width, height,\n bitmap.computeByteSize());\n }\n }\n}",
@ -188,6 +195,13 @@
"file": "SkBitmap_Reference", "file": "SkBitmap_Reference",
"name": "SkBitmap::height()", "name": "SkBitmap::height()",
"stdout": "bitmap height: 32 info height: 32\\n" "stdout": "bitmap height: 32 info height: 32\\n"
},
"SkBitmap_info": {
"code": "void draw(SkCanvas* canvas) {\n // SkBitmap source; // pre-populated with soccer ball by fiddle.skia.org\n const SkImageInfo& info = source.info();\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\"};\n SkDebugf(\"width: %d height: %d color: %s alpha: %s\\n\", info.width(), info.height(),\n colors[info.colorType()], alphas[info.alphaType()]);\n}\n",
"hash": "ec47c4dc23e2925ad565eaba55a91553",
"file": "SkBitmap_Reference",
"name": "SkBitmap::info()",
"stdout": "width: 56 height: 56 color: BGRA_8888 alpha: Opaque\\n"
}, },
"SkBitmap_installPixels": { "SkBitmap_installPixels": {
"code": "static void releaseProc(void* addr, void* ) {\n SkDebugf(\"releaseProc called\\n\");\n delete[] (uint32_t*) addr;\n}\n\nvoid draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n void* pixels = new uint32_t[8 * 8];\n SkImageInfo info = SkImageInfo::MakeN32(8, 8, kOpaque_SkAlphaType);\n SkDebugf(\"before installPixels\\n\");\n bool installed = bitmap.installPixels(info, pixels, 16, releaseProc, nullptr);\n SkDebugf(\"install \" \"%s\" \"successful\\n\", installed ? \"\" : \"not \");\n}\n", "code": "static void releaseProc(void* addr, void* ) {\n SkDebugf(\"releaseProc called\\n\");\n delete[] (uint32_t*) addr;\n}\n\nvoid draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n void* pixels = new uint32_t[8 * 8];\n SkImageInfo info = SkImageInfo::MakeN32(8, 8, kOpaque_SkAlphaType);\n SkDebugf(\"before installPixels\\n\");\n bool installed = bitmap.installPixels(info, pixels, 16, releaseProc, nullptr);\n SkDebugf(\"install \" \"%s\" \"successful\\n\", installed ? \"\" : \"not \");\n}\n",
@ -1541,8 +1555,8 @@
"stdout": "SkPaint::kNormal_Hinting == paint.getHinting()\\n" "stdout": "SkPaint::kNormal_Hinting == paint.getHinting()\\n"
}, },
"SkPaint_getImageFilter": { "SkPaint_getImageFilter": {
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkDebugf(\"nullptr %c= image filter\\n\", paint.getImageFilter() ? '!' : '=');\n paint.setImageFilter(SkBlurImageFilter::Make(kOuter_SkBlurStyle, 3, nullptr, nullptr));\n SkDebugf(\"nullptr %c= image filter\\n\", paint.getImageFilter() ? '!' : '=');\n}\n", "code": "#include \"SkBlurImageFilter.h\"\n\nvoid draw(SkCanvas* canvas) {\n SkPaint paint;\n SkDebugf(\"nullptr %c= image filter\\n\", paint.getImageFilter() ? '!' : '=');\n paint.setImageFilter(SkBlurImageFilter::Make(kOuter_SkBlurStyle, 3, nullptr, nullptr));\n SkDebugf(\"nullptr %c= image filter\\n\", paint.getImageFilter() ? '!' : '=');\n}\n",
"hash": "7b8118ff57fcb84e6bc82380d155b62e", "hash": "c11f8eaa1dd149bc18db21e23ce26904",
"file": "SkPaint_Reference", "file": "SkPaint_Reference",
"name": "SkPaint::getImageFilter", "name": "SkPaint::getImageFilter",
"stdout": "nullptr == image filter\\nnullptr != image filter\\n" "stdout": "nullptr == image filter\\nnullptr != image filter\\n"
@ -3177,6 +3191,13 @@
"file": "SkSurface_Reference", "file": "SkSurface_Reference",
"name": "SkSurface::MakeNull", "name": "SkSurface::MakeNull",
"stdout": "SkSurface::MakeNull(0, 0) == nullptr\\nsurf-\\u003emakeImageSnapshot() == nullptr\\n" "stdout": "SkSurface::MakeNull(0, 0) == nullptr\\nsurf-\\u003emakeImageSnapshot() == nullptr\\n"
},
"SkSurface_MakeRaster": {
"code": "void draw(SkCanvas* ) {\n SkImageInfo info = SkImageInfo::MakeN32Premul(3, 3);\n const size_t rowBytes = 64;\n sk_sp<SkSurface> surface(SkSurface::MakeRaster(info, rowBytes, nullptr));\n SkCanvas* canvas = surface->getCanvas();\n canvas->clear(SK_ColorWHITE);\n SkPixmap pixmap;\n if (surface->peekPixels(&pixmap)) {\n const uint32_t* colorPtr = pixmap.addr32();\n SkPMColor pmWhite = colorPtr[0];\n SkPaint paint;\n canvas->drawPoint(1, 1, paint);\n canvas->flush(); // ensure that point was drawn\n for (int y = 0; y < info.height(); ++y) {\n for (int x = 0; x < info.width(); ++x) {\n SkDebugf(\"%c\", colorPtr[x] == pmWhite ? '-' : 'x');\n }\n colorPtr += rowBytes / sizeof(colorPtr[0]);\n SkDebugf(\"\\n\");\n }\n }\n}\n",
"hash": "a803910ada4f8733f0b62456afead55f",
"file": "SkSurface_Reference",
"name": "SkSurface::MakeRaster",
"stdout": "---\\n-x-\\n---\\n"
}, },
"SkSurface_MakeRasterDirect": { "SkSurface_MakeRasterDirect": {
"code": "void draw(SkCanvas* ) {\n SkImageInfo info = SkImageInfo::MakeN32Premul(3, 3);\n const size_t size = info.computeMinByteSize();\n SkAutoTMalloc<SkPMColor> storage(size);\n SkPMColor* pixels = storage.get();\n sk_sp<SkSurface> surface(SkSurface::MakeRasterDirect(info, pixels, info.minRowBytes()));\n SkCanvas* canvas = surface->getCanvas();\n canvas->clear(SK_ColorWHITE);\n SkPMColor pmWhite = pixels[0];\n SkPaint paint;\n canvas->drawPoint(1, 1, paint);\n canvas->flush(); // ensure that point was drawn\n for (int y = 0; y < info.height(); ++y) {\n for (int x = 0; x < info.width(); ++x) {\n SkDebugf(\"%c\", *pixels++ == pmWhite ? '-' : 'x');\n }\n SkDebugf(\"\\n\");\n }\n}\n", "code": "void draw(SkCanvas* ) {\n SkImageInfo info = SkImageInfo::MakeN32Premul(3, 3);\n const size_t size = info.computeMinByteSize();\n SkAutoTMalloc<SkPMColor> storage(size);\n SkPMColor* pixels = storage.get();\n sk_sp<SkSurface> surface(SkSurface::MakeRasterDirect(info, pixels, info.minRowBytes()));\n SkCanvas* canvas = surface->getCanvas();\n canvas->clear(SK_ColorWHITE);\n SkPMColor pmWhite = pixels[0];\n SkPaint paint;\n canvas->drawPoint(1, 1, paint);\n canvas->flush(); // ensure that point was drawn\n for (int y = 0; y < info.height(); ++y) {\n for (int x = 0; x < info.width(); ++x) {\n SkDebugf(\"%c\", *pixels++ == pmWhite ? '-' : 'x');\n }\n SkDebugf(\"\\n\");\n }\n}\n",
@ -3205,6 +3226,13 @@
"file": "SkSurface_Reference", "file": "SkSurface_Reference",
"name": "SkSurface::MakeRaster_2", "name": "SkSurface::MakeRaster_2",
"stdout": "---\\n-x-\\n---\\n" "stdout": "---\\n-x-\\n---\\n"
},
"SkSurface_generationID": {
"code": "void draw(SkCanvas* canvas) {\n auto surface = SkSurface::MakeRasterN32Premul(1, 1);\n for (int i = 0; i < 3; ++i) {\n SkDebugf(\"surface generationID: %d\\n\", surface->generationID());\n if (0 == i) {\n surface->getCanvas()->drawColor(SK_ColorBLACK);\n } else {\n surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);\n }\n }\n}",
"hash": "be9574c4a14f891e1abb4ec2b1e51d6c",
"file": "SkSurface_Reference",
"name": "SkSurface::generationID",
"stdout": "surface generationID: 1\\nsurface generationID: 2\\nsurface generationID: 3\\n"
}, },
"SkSurface_height": { "SkSurface_height": {
"code": "void draw(SkCanvas* canvas) {\n const int width = 37;\n const int height = 1000;\n auto surf = SkSurface::MakeNull(width, height);\n auto nullCanvas = surf->getCanvas();\n SkDebugf(\"surface height=%d canvas height=%d\\n\", surf->height(),\n nullCanvas->getBaseLayerSize().fHeight);\n}", "code": "void draw(SkCanvas* canvas) {\n const int width = 37;\n const int height = 1000;\n auto surf = SkSurface::MakeNull(width, height);\n auto nullCanvas = surf->getCanvas();\n SkDebugf(\"surface height=%d canvas height=%d\\n\", surf->height(),\n nullCanvas->getBaseLayerSize().fHeight);\n}",
@ -3212,6 +3240,13 @@
"file": "SkSurface_Reference", "file": "SkSurface_Reference",
"name": "SkSurface::height()", "name": "SkSurface::height()",
"stdout": "surface height=1000 canvas height=1000\\n" "stdout": "surface height=1000 canvas height=1000\\n"
},
"SkSurface_notifyContentWillChange": {
"code": "void draw(SkCanvas* canvas) {\n auto surface = SkSurface::MakeRasterN32Premul(1, 1);\n for (int i = 0; i < 3; ++i) {\n SkDebugf(\"surface generationID: %d\\n\", surface->generationID());\n if (0 == i) {\n surface->getCanvas()->drawColor(SK_ColorBLACK);\n } else {\n surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);\n }\n }\n}",
"hash": "be9574c4a14f891e1abb4ec2b1e51d6c",
"file": "SkSurface_Reference",
"name": "SkSurface::notifyContentWillChange",
"stdout": "surface generationID: 1\\nsurface generationID: 2\\nsurface generationID: 3\\n"
}, },
"SkSurface_props": { "SkSurface_props": {
"code": "void draw(SkCanvas* canvas) {\n const char* names[] = { \"Unknown\", \"RGB_H\", \"BGR_H\", \"RGB_V\", \"BGR_V\" };\n sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));\n SkDebugf(\"surf.props(): k%s_SkPixelGeometry\\n\", names[surf->props().pixelGeometry()]);\n}", "code": "void draw(SkCanvas* canvas) {\n const char* names[] = { \"Unknown\", \"RGB_H\", \"BGR_H\", \"RGB_V\", \"BGR_V\" };\n sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));\n SkDebugf(\"surf.props(): k%s_SkPixelGeometry\\n\", names[surf->props().pixelGeometry()]);\n}",
@ -3566,10 +3601,10 @@
"name": "Font_Metrics" "name": "Font_Metrics"
}, },
"Paint_Image_Filter_Methods": { "Paint_Image_Filter_Methods": {
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setStrokeWidth(2);\n SkRegion region;\n region.op( 10, 10, 50, 50, SkRegion::kUnion_Op);\n region.op( 10, 50, 90, 90, SkRegion::kUnion_Op);\n paint.setImageFilter(SkBlurImageFilter::Make(5.0f, 5.0f, nullptr));\n canvas->drawRegion(region, paint);\n paint.setImageFilter(nullptr);\n paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, 5));\n canvas->translate(100, 100);\n canvas->drawRegion(region, paint);\n}\n", "code": "#include \"SkBlurImageFilter.h\"\n\nvoid draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setStrokeWidth(2);\n SkRegion region;\n region.op( 10, 10, 50, 50, SkRegion::kUnion_Op);\n region.op( 10, 50, 90, 90, SkRegion::kUnion_Op);\n paint.setImageFilter(SkBlurImageFilter::Make(5.0f, 5.0f, nullptr));\n canvas->drawRegion(region, paint);\n paint.setImageFilter(nullptr);\n paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, 5));\n canvas->translate(100, 100);\n canvas->drawRegion(region, paint);\n}\n",
"width": 256, "width": 256,
"height": 256, "height": 256,
"hash": "250e45c5935d54eac6aca775d1fe3475", "hash": "ece04ee3d3761e3425f37c8f06f054c1",
"file": "SkPaint_Reference", "file": "SkPaint_Reference",
"name": "Image_Filter_Methods" "name": "Image_Filter_Methods"
}, },
@ -3844,14 +3879,6 @@
"hash": "3e9126152ff1cc592aef6facbcb5fc96", "hash": "3e9126152ff1cc592aef6facbcb5fc96",
"file": "SkBitmap_Reference", "file": "SkBitmap_Reference",
"name": "SkBitmap::bounds()" "name": "SkBitmap::bounds()"
},
"SkBitmap_colorType": {
"code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\"};\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::MakeA8(16, 32));\n SkDebugf(\"color type: k\" \"%s\" \"_SkColorType\\n\", colors[bitmap.colorType()]);\n}",
"width": 256,
"height": 256,
"hash": "ceb77fab7326b57822a147b04aa0960e",
"file": "SkBitmap_Reference",
"name": "SkBitmap::colorType"
}, },
"SkBitmap_erase": { "SkBitmap_erase": {
"code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32(2, 2, kPremul_SkAlphaType));\n bitmap.erase(0x7fff7f3f, SkIRect::MakeWH(1, 1));\n bitmap.erase(0x7f7f3fff, SkIRect::MakeXYWH(0, 1, 1, 1));\n bitmap.erase(0x7f3fff7f, SkIRect::MakeXYWH(1, 0, 1, 1));\n bitmap.erase(0x7f1fbf5f, SkIRect::MakeXYWH(1, 1, 1, 1));\n canvas->scale(25, 25);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, .5f, .5f);\n}", "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32(2, 2, kPremul_SkAlphaType));\n bitmap.erase(0x7fff7f3f, SkIRect::MakeWH(1, 1));\n bitmap.erase(0x7f7f3fff, SkIRect::MakeXYWH(0, 1, 1, 1));\n bitmap.erase(0x7f3fff7f, SkIRect::MakeXYWH(1, 0, 1, 1));\n bitmap.erase(0x7f1fbf5f, SkIRect::MakeXYWH(1, 1, 1, 1));\n canvas->scale(25, 25);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, .5f, .5f);\n}",
@ -3916,14 +3943,6 @@
"hash": "0c45da35172bc0a529b2faecddae62a2", "hash": "0c45da35172bc0a529b2faecddae62a2",
"file": "SkBitmap_Reference", "file": "SkBitmap_Reference",
"name": "SkBitmap::getBounds_2" "name": "SkBitmap::getBounds_2"
},
"SkBitmap_info": {
"code": "void draw(SkCanvas* canvas) {\n // SkBitmap source; // pre-populated with soccer ball by fiddle.skia.org\n const SkImageInfo& info = source.info();\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\"};\n SkDebugf(\"width: %d height: %d color: %s alpha: %s\\n\", info.width(), info.height(),\n colors[info.colorType()], alphas[info.alphaType()]);\n}\n",
"width": 256,
"height": 256,
"hash": "ec47c4dc23e2925ad565eaba55a91553",
"file": "SkBitmap_Reference",
"name": "SkBitmap::info()"
}, },
"SkBitmap_installPixels_2": { "SkBitmap_installPixels_2": {
"code": "void draw(SkCanvas* canvas) {\n SkRandom random;\n SkBitmap bitmap;\n const int width = 8;\n const int height = 8;\n uint32_t pixels[width * height];\n for (unsigned x = 0; x < width * height; ++x) {\n pixels[x] = random.nextU();\n }\n SkImageInfo info = SkImageInfo::MakeN32(width, height, kUnpremul_SkAlphaType);\n if (bitmap.installPixels(info, pixels, info.minRowBytes())) {\n canvas->scale(32, 32);\n canvas->drawBitmap(bitmap, 0, 0);\n }\n}\n", "code": "void draw(SkCanvas* canvas) {\n SkRandom random;\n SkBitmap bitmap;\n const int width = 8;\n const int height = 8;\n uint32_t pixels[width * height];\n for (unsigned x = 0; x < width * height; ++x) {\n pixels[x] = random.nextU();\n }\n SkImageInfo info = SkImageInfo::MakeN32(width, height, kUnpremul_SkAlphaType);\n if (bitmap.installPixels(info, pixels, info.minRowBytes())) {\n canvas->scale(32, 32);\n canvas->drawBitmap(bitmap, 0, 0);\n }\n}\n",
@ -4798,10 +4817,10 @@
"name": "SkCanvas::save()" "name": "SkCanvas::save()"
}, },
"SkCanvas_saveLayer": { "SkCanvas_saveLayer": {
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint, blur;\n blur.setImageFilter(SkBlurImageFilter::Make(3, 3, nullptr));\n canvas->saveLayer(nullptr, &blur);\n SkRect rect = { 25, 25, 50, 50};\n canvas->drawRect(rect, paint);\n canvas->translate(50, 50);\n paint.setColor(SK_ColorRED);\n canvas->drawRect(rect, paint);\n canvas->restore();\n}\n", "code": "#include \"SkBlurImageFilter.h\"\n\nvoid draw(SkCanvas* canvas) {\n SkPaint paint, blur;\n blur.setImageFilter(SkBlurImageFilter::Make(3, 3, nullptr));\n canvas->saveLayer(nullptr, &blur);\n SkRect rect = { 25, 25, 50, 50};\n canvas->drawRect(rect, paint);\n canvas->translate(50, 50);\n paint.setColor(SK_ColorRED);\n canvas->drawRect(rect, paint);\n canvas->restore();\n}\n",
"width": 256, "width": 256,
"height": 128, "height": 128,
"hash": "1a025d6018f64140af2dc36acad59008", "hash": "42318b18d403e17e07a541652da91ee2",
"file": "SkCanvas_Reference", "file": "SkCanvas_Reference",
"name": "SkCanvas::saveLayer" "name": "SkCanvas::saveLayer"
}, },
@ -4822,10 +4841,10 @@
"name": "SkCanvas::saveLayerPreserveLCDTextRequests" "name": "SkCanvas::saveLayerPreserveLCDTextRequests"
}, },
"SkCanvas_saveLayer_2": { "SkCanvas_saveLayer_2": {
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint, blur;\n blur.setImageFilter(SkBlurImageFilter::Make(3, 3, nullptr));\n canvas->saveLayer(SkRect::MakeWH(90, 90), &blur);\n SkRect rect = { 25, 25, 50, 50};\n canvas->drawRect(rect, paint);\n canvas->translate(50, 50);\n paint.setColor(SK_ColorRED);\n canvas->drawRect(rect, paint);\n canvas->restore();\n}\n", "code": "#include \"SkBlurImageFilter.h\"\n\nvoid draw(SkCanvas* canvas) {\n SkPaint paint, blur;\n blur.setImageFilter(SkBlurImageFilter::Make(3, 3, nullptr));\n canvas->saveLayer(SkRect::MakeWH(90, 90), &blur);\n SkRect rect = { 25, 25, 50, 50};\n canvas->drawRect(rect, paint);\n canvas->translate(50, 50);\n paint.setColor(SK_ColorRED);\n canvas->drawRect(rect, paint);\n canvas->restore();\n}\n",
"width": 256, "width": 256,
"height": 128, "height": 128,
"hash": "5b59231feae0c09cb1ab6a292229d7a4", "hash": "a17aec3aa4909527be039e26a7eda694",
"file": "SkCanvas_Reference", "file": "SkCanvas_Reference",
"name": "SkCanvas::saveLayer_2" "name": "SkCanvas::saveLayer_2"
}, },
@ -7148,14 +7167,6 @@
"hash": "5e87093b9cbe95124ae14cbe77091eb7", "hash": "5e87093b9cbe95124ae14cbe77091eb7",
"file": "SkSurface_Reference", "file": "SkSurface_Reference",
"name": "SkSurface::MakeFromBackendTextureAsRenderTarget" "name": "SkSurface::MakeFromBackendTextureAsRenderTarget"
},
"SkSurface_MakeRaster": {
"code": "void draw(SkCanvas* ) {\n SkImageInfo info = SkImageInfo::MakeN32Premul(3, 3);\n const size_t rowBytes = 64;\n sk_sp<SkSurface> surface(SkSurface::MakeRaster(info, rowBytes, nullptr));\n SkCanvas* canvas = surface->getCanvas();\n canvas->clear(SK_ColorWHITE);\n SkPixmap pixmap;\n if (surface->peekPixels(&pixmap)) {\n const uint32_t* colorPtr = pixmap.addr32();\n SkPMColor pmWhite = colorPtr[0];\n SkPaint paint;\n canvas->drawPoint(1, 1, paint);\n canvas->flush(); // ensure that point was drawn\n for (int y = 0; y < info.height(); ++y) {\n for (int x = 0; x < info.width(); ++x) {\n SkDebugf(\"%c\", colorPtr[x] == pmWhite ? '-' : 'x');\n }\n colorPtr += rowBytes / sizeof(colorPtr[0]);\n SkDebugf(\"\\n\");\n }\n }\n}\n",
"width": 256,
"height": 256,
"hash": "a803910ada4f8733f0b62456afead55f",
"file": "SkSurface_Reference",
"name": "SkSurface::MakeRaster"
}, },
"SkSurface_MakeRenderTarget": { "SkSurface_MakeRenderTarget": {
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(32);\n GrContext* context = canvas->getGrContext();\n if (!context) {\n canvas->drawString(\"GPU only!\", 20, 40, paint);\n return;\n }\n SkImageInfo info = SkImageInfo::MakeN32(256, 64, kOpaque_SkAlphaType);\n for (auto surfaceOrigin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin } ) {\n auto gpuSurface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info, 0,\n surfaceOrigin, nullptr));\n auto surfaceCanvas = gpuSurface->getCanvas();\n surfaceCanvas->clear(SK_ColorWHITE);\n surfaceCanvas->drawString(\"GPU rocks!\", 20, 40, paint);\n sk_sp<SkImage> image(gpuSurface->makeImageSnapshot());\n canvas->drawImage(image, 0, 0);\n canvas->translate(0, 128);\n }\n}", "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(32);\n GrContext* context = canvas->getGrContext();\n if (!context) {\n canvas->drawString(\"GPU only!\", 20, 40, paint);\n return;\n }\n SkImageInfo info = SkImageInfo::MakeN32(256, 64, kOpaque_SkAlphaType);\n for (auto surfaceOrigin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin } ) {\n auto gpuSurface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info, 0,\n surfaceOrigin, nullptr));\n auto surfaceCanvas = gpuSurface->getCanvas();\n surfaceCanvas->clear(SK_ColorWHITE);\n surfaceCanvas->drawString(\"GPU rocks!\", 20, 40, paint);\n sk_sp<SkImage> image(gpuSurface->makeImageSnapshot());\n canvas->drawImage(image, 0, 0);\n canvas->translate(0, 128);\n }\n}",
@ -7204,14 +7215,6 @@
"hash": "46d9bacf593deaaeabd74ff42f2571a0", "hash": "46d9bacf593deaaeabd74ff42f2571a0",
"file": "SkSurface_Reference", "file": "SkSurface_Reference",
"name": "SkSurface::draw_2" "name": "SkSurface::draw_2"
},
"SkSurface_generationID": {
"code": "void draw(SkCanvas* canvas) {\n auto surface = SkSurface::MakeRasterN32Premul(1, 1);\n for (int i = 0; i < 3; ++i) {\n SkDebugf(\"surface generationID: %d\\n\", surface->generationID());\n if (0 == i) {\n surface->getCanvas()->drawColor(SK_ColorBLACK);\n } else {\n surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);\n }\n }\n}",
"width": 256,
"height": 256,
"hash": "be9574c4a14f891e1abb4ec2b1e51d6c",
"file": "SkSurface_Reference",
"name": "SkSurface::generationID"
}, },
"SkSurface_getCanvas": { "SkSurface_getCanvas": {
"code": "void draw(SkCanvas* canvas) {\n sk_sp<SkSurface> surface(SkSurface::MakeRasterN32Premul(64, 64));\n SkCanvas* surfaceCanvas = surface->getCanvas();\n surfaceCanvas->clear(SK_ColorBLUE);\n SkPaint paint;\n paint.setTextSize(40);\n surfaceCanvas->drawString(\"\\xF0\\x9F\\x98\\x81\", 12, 45, paint);\n surface->draw(canvas, 0, 0, nullptr);\n}", "code": "void draw(SkCanvas* canvas) {\n sk_sp<SkSurface> surface(SkSurface::MakeRasterN32Premul(64, 64));\n SkCanvas* surfaceCanvas = surface->getCanvas();\n surfaceCanvas->clear(SK_ColorBLUE);\n SkPaint paint;\n paint.setTextSize(40);\n surfaceCanvas->drawString(\"\\xF0\\x9F\\x98\\x81\", 12, 45, paint);\n surface->draw(canvas, 0, 0, nullptr);\n}",
@ -7236,14 +7239,6 @@
"hash": "a9889b519a26896b900da0444e423c61", "hash": "a9889b519a26896b900da0444e423c61",
"file": "SkSurface_Reference", "file": "SkSurface_Reference",
"name": "SkSurface::makeSurface" "name": "SkSurface::makeSurface"
},
"SkSurface_notifyContentWillChange": {
"code": "void draw(SkCanvas* canvas) {\n auto surface = SkSurface::MakeRasterN32Premul(1, 1);\n for (int i = 0; i < 3; ++i) {\n SkDebugf(\"surface generationID: %d\\n\", surface->generationID());\n if (0 == i) {\n surface->getCanvas()->drawColor(SK_ColorBLACK);\n } else {\n surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);\n }\n }\n}",
"width": 256,
"height": 256,
"hash": "be9574c4a14f891e1abb4ec2b1e51d6c",
"file": "SkSurface_Reference",
"name": "SkSurface::notifyContentWillChange"
}, },
"SkSurface_peekPixels": { "SkSurface_peekPixels": {
"code": "void draw(SkCanvas* canvas) {\n sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));\n auto surfCanvas = surf->getCanvas();\n surfCanvas->clear(SK_ColorRED);\n SkPaint paint;\n paint.setTextSize(40);\n surfCanvas->drawString(\"&\", 16, 48, paint);\n SkPixmap pixmap;\n if (surf->peekPixels(&pixmap)) {\n SkBitmap surfBits;\n surfBits.installPixels(pixmap);\n canvas->drawBitmap(surfBits, 0, 0);\n }\n}", "code": "void draw(SkCanvas* canvas) {\n sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));\n auto surfCanvas = surf->getCanvas();\n surfCanvas->clear(SK_ColorRED);\n SkPaint paint;\n paint.setTextSize(40);\n surfCanvas->drawString(\"&\", 16, 48, paint);\n SkPixmap pixmap;\n if (surf->peekPixels(&pixmap)) {\n SkBitmap surfBits;\n surfBits.installPixels(pixmap);\n canvas->drawBitmap(surfBits, 0, 0);\n }\n}",

View File

@ -1323,6 +1323,7 @@ bool BmhParser::findDefinitions() {
if (!this->skipSpace()) { if (!this->skipSpace()) {
return this->reportError<bool>("unexpected end"); return this->reportError<bool>("unexpected end");
} }
lineStart = '\n' == this->peek();
bool expectEnd = true; bool expectEnd = true;
vector<string> typeNameBuilder = this->typeName(markType, &expectEnd); vector<string> typeNameBuilder = this->typeName(markType, &expectEnd);
if (fCloned && MarkType::kMethod != markType && MarkType::kExample != markType if (fCloned && MarkType::kMethod != markType && MarkType::kExample != markType
@ -1448,9 +1449,11 @@ bool BmhParser::findDefinitions() {
} }
} }
char nextChar = this->next(); char nextChar = this->next();
lineStart = nextChar == '\n';
if (' ' < nextChar) { if (' ' < nextChar) {
lastChar = fChar; lastChar = fChar;
lineStart = false;
} else if (nextChar == '\n') {
lineStart = true;
} }
} }
if (fParent) { if (fParent) {