diff options
author | Cary Clark <caryclark@skia.org> | 2018-07-17 13:19:56 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-17 17:27:10 +0000 |
commit | e80cd44cb2c549b709022a62a1fa9f8d6a7822ec (patch) | |
tree | 76b90d88c667317886c85002040c77ee9b07def9 /docs | |
parent | a8cdbd7431b6a27d28db1bc80d7557cedf7e66d0 (diff) |
fix bookmaker build bot
Sync up with deletion of SkTransferFunctionBehavior.
TBR=brianosman@google.com
NOTRY=true
Docs-Preview: https://skia.org/?cl=141828
Bug: skia:6818
Change-Id: Ibcfad17b8e886a4c980e4eb2bbae5a007f4bb36e
Reviewed-on: https://skia-review.googlesource.com/141828
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SkBitmap_Reference.bmh | 157 | ||||
-rw-r--r-- | docs/SkCanvas_Reference.bmh | 44 | ||||
-rw-r--r-- | docs/SkImage_Reference.bmh | 18 | ||||
-rw-r--r-- | docs/SkPixmap_Reference.bmh | 83 | ||||
-rw-r--r-- | docs/undocumented.bmh | 6 |
5 files changed, 26 insertions, 282 deletions
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh index 1fd2b520de..5bf8e1b2e4 100644 --- a/docs/SkBitmap_Reference.bmh +++ b/docs/SkBitmap_Reference.bmh @@ -2743,94 +2743,9 @@ subset: 1000, 100, 1000, 200 success; false # ------------------------------------------------------------------------------ #Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, - int srcX, int srcY, SkTransferFunctionBehavior behavior) const -#In Pixels -#Line # copies and converts pixels ## - -Copies Rect of pixels from Bitmap pixels to dstPixels. Copy starts at (srcX, srcY), -and does not exceed Bitmap (width(), height()). - -dstInfo specifies width, height, Color_Type, Alpha_Type, and -Color_Space of destination. dstRowBytes specifics the gap from one destination -row to the next. Returns true if pixels are copied. Returns false if: -#List -# dstInfo.addr() equals nullptr ## -# dstRowBytes is less than dstInfo.minRowBytes ## -# Pixel_Ref is nullptr ## -## - -Pixels are copied only if pixel conversion is possible. If Bitmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match. -If Bitmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match. -If Bitmap alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must -match. If Bitmap colorSpace is nullptr, dstInfo.colorSpace must match. Returns -false if pixel conversion is not possible. - -srcX and srcY may be negative to copy only top or left of source. Returns -false if width() or height() is zero or negative. -Returns false if -#Formula -abs(srcX) >= Bitmap width() -## -, or if -#Formula -abs(srcY) >= Bitmap height() -## -. - -If behavior is SkTransferFunctionBehavior::kRespect: converts source -pixels to a linear space before converting to dstInfo. -If behavior is SkTransferFunctionBehavior::kIgnore: source -pixels are treated as if they are linear, regardless of how they are encoded. - -#Param dstInfo destination width, height, Color_Type, Alpha_Type, Color_Space ## -#Param dstPixels destination pixel storage ## -#Param dstRowBytes destination row length ## -#Param srcX column index whose absolute value is less than width() ## -#Param srcY row index whose absolute value is less than height() ## -#Param behavior one of: SkTransferFunctionBehavior::kRespect, - SkTransferFunctionBehavior::kIgnore -## - -#Return true if pixels are copied to dstPixels ## - -#Example -#Height 64 -void draw(SkCanvas* canvas) { - const int width = 256; - const int height = 32; - std::vector<int32_t> dstPixels; - dstPixels.resize(height * width * 4); - SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); - SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 }; - SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } }; - SkPaint gradPaint; - gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr, - SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode)); - for (auto behavior : { SkTransferFunctionBehavior::kRespect, - SkTransferFunctionBehavior::kIgnore} ) { - SkBitmap bitmap; - bitmap.allocPixels(info); - SkCanvas srcCanvas(bitmap); - srcCanvas.drawRect(SkRect::MakeWH(width, height), gradPaint); - if (bitmap.readPixels(info, &dstPixels.front(), width * 4, 0, 0, behavior)) { - SkPixmap dstPixmap(info, &dstPixels.front(), width * 4); - bitmap.installPixels(dstPixmap); - canvas->drawBitmap(bitmap, 0, 0); - } - canvas->translate(0, height); - } -} -## - -#SeeAlso writePixels SkPixmap::readPixels SkCanvas::readPixels SkImage::readPixels SkSurface::readPixels - -## - -# ------------------------------------------------------------------------------ - -#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const +#In Pixels +#Line # copies and converts pixels ##
Copies a Rect of pixels from Bitmap to dstPixels. Copy starts at (srcX, srcY), and does not exceed Bitmap (width(), height()). @@ -3129,74 +3044,6 @@ false if pixel conversion is not possible. # ------------------------------------------------------------------------------ -#Method bool writePixels(const SkPixmap& src, int x, int y, SkTransferFunctionBehavior behavior) - -Copies a Rect of pixels from src. Copy starts at (0, 0), and does not exceed -(src.width(), src.height()). - -src specifies width, height, Color_Type, Alpha_Type, Color_Space, pixel storage, -and row bytes of source. src.rowBytes specifics the gap from one source -row to the next. Returns true if pixels are copied. Returns false if: -#List -# src pixel storage equals nullptr ## -# src.rowBytes is less than SkImageInfo::minRowBytes ## -# Pixel_Ref is nullptr ## -## - -Pixels are copied only if pixel conversion is possible. If Bitmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; src Color_Type must match. -If Bitmap colorType is kGray_8_SkColorType, src Color_Space must match. -If Bitmap alphaType is kOpaque_SkAlphaType, src Alpha_Type must -match. If Bitmap colorSpace is nullptr, src Color_Space must match. Returns -false if pixel conversion is not possible. Returns false if width() or height() -is zero or negative. - -If behavior is SkTransferFunctionBehavior::kRespect: converts src -pixels to a linear space before converting to Image_Info. -If behavior is SkTransferFunctionBehavior::kIgnore: src -pixels are treated as if they are linear, regardless of how they are encoded. - -#Param src source Pixmap: Image_Info, pixels, row bytes ## -#Param x column index whose absolute value is less than width() ## -#Param y row index whose absolute value is less than height() ## -#Param behavior one of: SkTransferFunctionBehavior::kRespect, - SkTransferFunctionBehavior::kIgnore -## - -#Return true if src pixels are copied to Bitmap ## - -#Example -#Height 64 - const int width = 256; - const int height = 32; - std::vector<int32_t> dstPixels; - dstPixels.resize(height * width * 4); - SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); - SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 }; - SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } }; - SkPaint gradPaint; - gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr, - SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode)); - for (auto behavior : { SkTransferFunctionBehavior::kRespect, - SkTransferFunctionBehavior::kIgnore} ) { - SkPixmap dstPixmap(info, &dstPixels.front(), width * 4); - SkBitmap bitmap; - bitmap.installPixels(dstPixmap); - SkCanvas srcCanvas(bitmap); - srcCanvas.drawRect(SkRect::MakeWH(width, height), gradPaint); - if (bitmap.writePixels(dstPixmap, 0, 0, behavior)) { - canvas->drawBitmap(bitmap, 0, 0); - } - canvas->translate(0, height); - } -## - -#SeeAlso readPixels - -## - -# ------------------------------------------------------------------------------ - #Method bool hasHardwareMipMap() const #In Property #Line # returns Mip_Map support present; Android only ## diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh index 32dee8193f..dabec688ea 100644 --- a/docs/SkCanvas_Reference.bmh +++ b/docs/SkCanvas_Reference.bmh @@ -5461,29 +5461,29 @@ Image_Filter, and Draw_Looper; apply to blob. #Example #Height 120 - void draw(SkCanvas* canvas) { - SkTextBlobBuilder textBlobBuilder; - const char bunny[] = "/(^x^)\\"; - const int len = sizeof(bunny) - 1; - uint16_t glyphs[len]; - SkPaint paint; - paint.textToGlyphs(bunny, len, glyphs); - paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); - int runs[] = { 3, 1, 3 }; - SkPoint textPos = { 20, 100 }; - int glyphIndex = 0; - for (auto runLen : runs) { - paint.setTextSize(1 == runLen ? 20 : 50); - const SkTextBlobBuilder::RunBuffer& run = - textBlobBuilder.allocRun(paint, runLen, textPos.fX, textPos.fY); - memcpy(run.glyphs, &glyphs[glyphIndex], sizeof(glyphs[0]) * runLen); - textPos.fX += paint.measureText(&glyphs[glyphIndex], sizeof(glyphs[0]) * runLen, nullptr); - glyphIndex += runLen; - } - sk_sp<const SkTextBlob> blob = textBlobBuilder.make(); - paint.reset(); - canvas->drawTextBlob(blob.get(), 0, 0, paint); +void draw(SkCanvas* canvas) { + SkTextBlobBuilder textBlobBuilder; + const char bunny[] = "/(^x^)\\"; + const int len = sizeof(bunny) - 1; + uint16_t glyphs[len]; + SkPaint paint; + paint.textToGlyphs(bunny, len, glyphs); + paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); + int runs[] = { 3, 1, 3 }; + SkPoint textPos = { 20, 100 }; + int glyphIndex = 0; + for (auto runLen : runs) { + paint.setTextSize(1 == runLen ? 20 : 50); + const SkTextBlobBuilder::RunBuffer& run = + textBlobBuilder.allocRun(paint, runLen, textPos.fX, textPos.fY); + memcpy(run.glyphs, &glyphs[glyphIndex], sizeof(glyphs[0]) * runLen); + textPos.fX += paint.measureText(&glyphs[glyphIndex], sizeof(glyphs[0]) * runLen, nullptr); + glyphIndex += runLen; } + sk_sp<const SkTextBlob> blob = textBlobBuilder.make(); + paint.reset(); + canvas->drawTextBlob(blob.get(), 0, 0, paint); +} ## #SeeAlso drawText drawPosText drawPosTextH diff --git a/docs/SkImage_Reference.bmh b/docs/SkImage_Reference.bmh index 1c329801a8..28c98d247c 100644 --- a/docs/SkImage_Reference.bmh +++ b/docs/SkImage_Reference.bmh @@ -2187,9 +2187,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ -#Method sk_sp<SkImage> makeColorSpace( - sk_sp<SkColorSpace> target, - SkTransferFunctionBehavior premulBehavior = SkTransferFunctionBehavior::kIgnore) const +#Method sk_sp<SkImage> makeColorSpace(sk_sp<SkColorSpace> target) const #In Constructor #Line # creates Image matching Color_Space if possible ## @@ -2200,21 +2198,7 @@ Returns original Image if it is in target Color_Space. Otherwise, converts pixels from Image Color_Space to target Color_Space. If Image colorSpace returns nullptr, Image Color_Space is assumed to be sRGB. -SkTransferFunctionBehavior is to be deprecated. - -Set premulBehavior to SkTransferFunctionBehavior::kRespect to convert Image -pixels to a linear space, before converting to destination Color_Type -and Color_Space. - -Set premulBehavior to SkTransferFunctionBehavior::kIgnore to treat Image -pixels as linear, when converting to destination Color_Type -and Color_Space, ignoring pixel encoding. premulBehavior is -SkTransferFunctionBehavior::kIgnore by default. - #Param target Color_Space describing color range of returned Image ## -#Param premulBehavior one of: SkTransferFunctionBehavior::kRespect, - SkTransferFunctionBehavior::kIgnore -## #Return created Image in target Color_Space ## diff --git a/docs/SkPixmap_Reference.bmh b/docs/SkPixmap_Reference.bmh index 93d47b50ea..051a6a1f83 100644 --- a/docs/SkPixmap_Reference.bmh +++ b/docs/SkPixmap_Reference.bmh @@ -1494,91 +1494,10 @@ is drawn after overwriting bottom half float color with top half float color. # ------------------------------------------------------------------------------ -#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, - int srcX, int srcY, SkTransferFunctionBehavior behavior) const +#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const #In Pixels #Line # copies and converts pixels ## -Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not -exceed Pixmap (width(), height()). - -dstInfo specifies width, height, Color_Type, Alpha_Type, and -Color_Space of destination. dstRowBytes specifics the gap from one destination -row to the next. Returns true if pixels are copied. Returns false if -dstInfo.addr() equals nullptr, or dstRowBytes is less than dstInfo.minRowBytes. - -Pixels are copied only if pixel conversion is possible. If Pixmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match. -If Pixmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match. -If Pixmap alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must -match. If Pixmap colorSpace is nullptr, dstInfo.colorSpace must match. Returns -false if pixel conversion is not possible. - -srcX and srcY may be negative to copy only top or left of source. Returns -false if width() or height() is zero or negative. Returns false if: - -#Formula -abs(srcX) >= Pixmap width() -## -, or if -#Formula -abs(srcY) >= Pixmap height() -## -. - -If behavior is SkTransferFunctionBehavior::kRespect: converts source -pixels to a linear space before converting to dstInfo. -If behavior is SkTransferFunctionBehavior::kIgnore: source -pixels are treated as if they are linear, regardless of how they are encoded. - -#Param dstInfo destination width, height, Color_Type, Alpha_Type, Color_Space ## -#Param dstPixels destination pixel storage ## -#Param dstRowBytes destination row length ## -#Param srcX column index whose absolute value is less than width() ## -#Param srcY row index whose absolute value is less than height() ## -#Param behavior one of: SkTransferFunctionBehavior::kRespect, - SkTransferFunctionBehavior::kIgnore -## - -#Return true if pixels are copied to dstPixels ## - -#Example -#ToDo example doesn't do anything interesting since image doesn't have alpha ## -#Image 3 -void draw(SkCanvas* canvas) { - SkImageInfo srgb = SkImageInfo::MakeS32(image->width(), image->height(), - kPremul_SkAlphaType); - SkImageInfo linear = srgb.makeColorSpace(srgb.colorSpace()->makeLinearGamma()); - std::vector<int32_t> srcPixels; - size_t rowBytes = image->width() * 4; - srcPixels.resize(image->height() * rowBytes); - SkPixmap pixmap(srgb, (const void*) &srcPixels.front(), rowBytes); - image->readPixels(pixmap, 0, 0); - int offset = -64; - std::vector<int32_t> dstPixels; - dstPixels.resize(image->height() * rowBytes); - for (const auto& info : { srgb, linear } ) { - for (auto behavior : { SkTransferFunctionBehavior::kRespect, - SkTransferFunctionBehavior::kIgnore} ) { - pixmap.readPixels(info, &dstPixels.front(), rowBytes, 0, 0, behavior); - SkBitmap bitmap; - SkPixmap dstmap(info, &dstPixels.front(), rowBytes); - bitmap.installPixels(dstmap); - canvas->drawBitmap(bitmap, 0, offset += 64); - } - } -} -## - -#SeeAlso erase SkBitmap::readPixels SkCanvas::drawBitmap SkCanvas::readPixels SkImage::readPixels SkSurface::readPixels - -## - -# ------------------------------------------------------------------------------ - -#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const - -#In Pixels Copies a Rect of pixels to dstPixels. Copy starts at (0, 0), and does not exceed Pixmap (width(), height()). diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh index 86c9275cf9..490ebf07ed 100644 --- a/docs/undocumented.bmh +++ b/docs/undocumented.bmh @@ -215,12 +215,6 @@ FT_Load_Glyph #Method static bool Equals(const SkColorSpace* src, const SkColorSpace* dst) ## ## -#EnumClass SkTransferFunctionBehavior -#Const kRespect 0 -## -#Const kIgnore 1 -## -#EnumClass ## ## #Topic Create_Color_Space_Xform_Canvas |