fix bookmaker files

make edits compile

Next time, could you put me on the review if you are going to
edit bookmaker files? I'm happy to preflight the changes
to see if they break the bots.

Docs-Preview: https://skia.org/?cl=135703
NOTRY=true
Bug: skia:6898
Change-Id: Iae054f19b131e894f73cedda279ee98af99e8c1c
Reviewed-on: https://skia-review.googlesource.com/135703
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
This commit is contained in:
Cary Clark 2018-06-19 09:07:28 -04:00 committed by Skia Commit-Bot
parent 5607143361
commit 929e436c98
7 changed files with 11 additions and 13 deletions

View File

@ -676,9 +676,8 @@ hsv[2] contains HSV_Value, a value from zero to one.
for (int y = 0; y < 256; ++y) {
for (int x = 0; x < 256; ++x) {
SkScalar hsv[3];
SkColorToHSV(source.getColor(x, y), hsv)
using std::swap;
swap(hsv[1], hsv[2]);
SkColorToHSV(source.getColor(x, y), hsv);
std::swap(hsv[1], hsv[2]);
SkPaint paint;
paint.setColor(SkHSVToColor(hsv));
canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);

View File

@ -762,7 +762,7 @@ kRGBA_8888_SkColorType.
#Line # encodes ARGB as half floats ##
kRGBA_F16_SkColorType encodes ARGB into a 64-bit word. Each component:
blue, green, red, and alpha; use 16 bits, describing a floating point value.
from -65500 to 65000 with 3.31 decimal digits of precision.
from -65500 to 65000 with 3.31 decimal digits of precision.
At present, Color in Paint does not provide enough precision or range to
draw all colors possible to a kRGBA_F16_SkColorType Surface.

View File

@ -1387,8 +1387,7 @@ One word corresponds to one pixel.
for (int y = 0; y < pixmap.height() / 2; ++y) {
for (int x = 0; x < pixmap.width(); ++x) {
if ((x & 4) == (y & 4)) {
using std::swap;
swap(*pixmap.writable_addr32(x, y),
std::swap(*pixmap.writable_addr32(x, y),
*pixmap.writable_addr32(pixmap.width() - x, pixmap.height() - y));
}
}

View File

@ -832,7 +832,7 @@ Converts ARGB to its <a href='#HSV'>HSV</a> components. <a href='#Alpha'>Alpha</
### Example
<div><fiddle-embed name="7d7e427e2b181c651abad5732bc46cf7"></fiddle-embed></div>
<div><fiddle-embed name="f0912ac97910b2fe5963d3b360795139"></fiddle-embed></div>
### See Also

View File

@ -702,7 +702,7 @@ opaque as if its <a href='SkColor_Reference#Alpha'>Color Alpha</a> was set to on
<a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> encodes ARGB into a 64-bit word. Each component:
blue, green, red, and alpha; use 16 bits, describing a floating point value.
from -65500 to 65000 with 3.31 decimal digits of precision.
from -65500 to 65000 with 3.31 decimal digits of precision.
At present, <a href='SkColor_Reference#Color'>Color</a> in <a href='SkPaint_Reference#Paint'>Paint</a> does not provide enough precision or range to
draw all colors possible to a <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a>.

View File

@ -1691,7 +1691,7 @@ writable unsigned 32-bit pointer to pixel
### Example
<div><fiddle-embed name="d99d5d394182e8c2c0cab402f93ca6c7"></fiddle-embed></div>
<div><fiddle-embed name="ba9a9d2d78a51adb554d75780a3bcd4d"></fiddle-embed></div>
### See Also

View File

@ -4977,10 +4977,10 @@
"name": "SkColorSetRGB"
},
"SkColorToHSV": {
"code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n for (int y = 0; y < 256; ++y) {\n for (int x = 0; x < 256; ++x) {\n SkScalar hsv[3];\n SkColorToHSV(source.getColor(x, y), hsv);\n SkTSwap(hsv[1], hsv[2]);\n SkPaint paint;\n paint.setColor(SkHSVToColor(hsv));\n canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);\n }\n }\n}",
"code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n for (int y = 0; y < 256; ++y) {\n for (int x = 0; x < 256; ++x) {\n SkScalar hsv[3];\n SkColorToHSV(source.getColor(x, y), hsv);\n std::swap(hsv[1], hsv[2]);\n SkPaint paint;\n paint.setColor(SkHSVToColor(hsv));\n canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);\n }\n }\n}",
"width": 256,
"height": 256,
"hash": "7d7e427e2b181c651abad5732bc46cf7",
"hash": "f0912ac97910b2fe5963d3b360795139",
"file": "SkColor_Reference",
"name": "SkColorToHSV"
},
@ -6905,10 +6905,10 @@
"name": "SkPixmap::writable_addr16"
},
"SkPixmap_writable_addr32": {
"code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> pixels;\n pixels.resize(image->height() * image->width() * 4);\n SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n image->readPixels(pixmap, 0, 0);\n for (int y = 0; y < pixmap.height() / 2; ++y) {\n for (int x = 0; x < pixmap.width(); ++x) {\n if ((x & 4) == (y & 4)) {\n SkTSwap(*pixmap.writable_addr32(x, y),\n *pixmap.writable_addr32(pixmap.width() - x, pixmap.height() - y));\n }\n }\n }\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}",
"code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> pixels;\n pixels.resize(image->height() * image->width() * 4);\n SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n image->readPixels(pixmap, 0, 0);\n for (int y = 0; y < pixmap.height() / 2; ++y) {\n for (int x = 0; x < pixmap.width(); ++x) {\n if ((x & 4) == (y & 4)) {\n std::swap(*pixmap.writable_addr32(x, y),\n *pixmap.writable_addr32(pixmap.width() - x, pixmap.height() - y));\n }\n }\n }\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}",
"width": 256,
"height": 72,
"hash": "d99d5d394182e8c2c0cab402f93ca6c7",
"hash": "ba9a9d2d78a51adb554d75780a3bcd4d",
"file": "SkPixmap_Reference",
"name": "SkPixmap::writable_addr32"
},