aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/user/api
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-06-19 12:57:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-19 19:51:19 +0000
commit4d75975b70c454288226afc03e512ad9bc2db5ac (patch)
treeea8aa7bd8c7a30b68a9674f5bdc91a42fb085c7b /site/user/api
parent796bc1db0ef1600ed8d2e7206642306982210055 (diff)
simplify confusing examples
Docs-Preview: https://skia.org/?cl=135785 Bug: skia:6898 Change-Id: Idf5e44817a86accaa628ea5d7abb47cd2b06d048 Reviewed-on: https://skia-review.googlesource.com/135785 Commit-Queue: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'site/user/api')
-rw-r--r--site/user/api/SkColor_Reference.md2
-rw-r--r--site/user/api/SkPixmap_Reference.md2
-rw-r--r--site/user/api/catalog.htm8
3 files changed, 6 insertions, 6 deletions
diff --git a/site/user/api/SkColor_Reference.md b/site/user/api/SkColor_Reference.md
index b03b25fc24..3dbbea58a3 100644
--- a/site/user/api/SkColor_Reference.md
+++ b/site/user/api/SkColor_Reference.md
@@ -832,7 +832,7 @@ Converts ARGB to its <a href='#HSV'>HSV</a> components. <a href='#Alpha'>Alpha</
### Example
-<div><fiddle-embed name="f0912ac97910b2fe5963d3b360795139"></fiddle-embed></div>
+<div><fiddle-embed name="1e0370f12c8aab5b84f9e824074f1e5a"></fiddle-embed></div>
### See Also
diff --git a/site/user/api/SkPixmap_Reference.md b/site/user/api/SkPixmap_Reference.md
index 56232c0477..9fb64e9e0a 100644
--- a/site/user/api/SkPixmap_Reference.md
+++ b/site/user/api/SkPixmap_Reference.md
@@ -1691,7 +1691,7 @@ writable unsigned 32-bit pointer to pixel
### Example
-<div><fiddle-embed name="ba9a9d2d78a51adb554d75780a3bcd4d"></fiddle-embed></div>
+<div><fiddle-embed name="086866243bf9e4c14c3b215a2aa69ad9"></fiddle-embed></div>
### See Also
diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm
index ea380cd2a6..ae788ee1a5 100644
--- a/site/user/api/catalog.htm
+++ b/site/user/api/catalog.htm
@@ -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 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}",
+ "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 hsv[1] = 1 - hsv[1];\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": "f0912ac97910b2fe5963d3b360795139",
+ "hash": "1e0370f12c8aab5b84f9e824074f1e5a",
"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 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}",
+ "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 *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": "ba9a9d2d78a51adb554d75780a3bcd4d",
+ "hash": "086866243bf9e4c14c3b215a2aa69ad9",
"file": "SkPixmap_Reference",
"name": "SkPixmap::writable_addr32"
},