diff options
author | Cary Clark <caryclark@skia.org> | 2018-03-05 13:26:16 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-05 18:48:15 +0000 |
commit | 1a8d762a18d6f6494408a3a5e06a80097f8b85f7 (patch) | |
tree | d4ccb89175936ecfeceb205bc60a2af536d96de1 /docs | |
parent | f6188425c7501ee0d7485d933f0c93b25972e58b (diff) |
work in imageinfo and phrase substitution
This adds the ability to define long phrases
in one place and refer to those phrases in
many places.
Bookmaker has new syntax to support phrase substitution.
When it encounters
#some_phrase_reference#
It substitutes the body of
#PhraseDef some_phrase_reference
text to substitute when encountering the phrase
##
The phrase label must start with a lowercase letter,
and be bracketed by single hash marks, without spaces
between the label and the hash marks.
Docs-Preview: https://skia.org/?cl=111224
TBR=caryclark@google.com
Bug: skia:6898
Change-Id: I12c57d916ccedbd86b421377d117399150ada72a
Reviewed-on: https://skia-review.googlesource.com/111224
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SkBitmap_Reference.bmh | 60 | ||||
-rw-r--r-- | docs/SkImageInfo_Reference.bmh | 311 | ||||
-rw-r--r-- | docs/SkImage_Reference.bmh | 15 | ||||
-rw-r--r-- | docs/SkPaint_Reference.bmh | 8 | ||||
-rw-r--r-- | docs/SkPath_Reference.bmh | 7 | ||||
-rw-r--r-- | docs/SkPixmap_Reference.bmh | 5 | ||||
-rw-r--r-- | docs/SkSurface_Reference.bmh | 19 |
7 files changed, 299 insertions, 126 deletions
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh index 39719a9149..353d244976 100644 --- a/docs/SkBitmap_Reference.bmh +++ b/docs/SkBitmap_Reference.bmh @@ -509,9 +509,7 @@ bitmap height: 32 info height: 32 #Method SkColorType colorType() const #In Property #Line # returns Image_Info Color_Type ## -Returns Color_Type, one of: kUnknown_SkColorType, kAlpha_8_SkColorType, -kRGB_565_SkColorType, kARGB_4444_SkColorType, kRGBA_8888_SkColorType, -kBGRA_8888_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType. +Returns Color_Type, one of: #list_of_color_types#. #Return Color_Type in Image_Info ## @@ -634,24 +632,24 @@ Returns zero if colorType( is kUnknown_SkColorType. "BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"}; SkImageInfo info = SkImageInfo::MakeA8(1, 1); SkBitmap bitmap; - for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType, - kRGB_565_SkColorType, kARGB_4444_SkColorType, - kRGBA_8888_SkColorType, - kBGRA_8888_SkColorType, kGray_8_SkColorType, - kRGBA_F16_SkColorType } ) { + for (SkColorType colorType : { #list_of_color_types# + } ) { bitmap.setInfo(info.makeColorType(colorType)); SkDebugf("color: k" "%s" "_SkColorType" "%*s" "bytesPerPixel: %d\n", colors[colorType], 13 - strlen(colors[colorType]), " ", bitmap.bytesPerPixel()); } #StdOut -color: kUnknown_SkColorType bytesPerPixel: 0 -color: kAlpha_8_SkColorType bytesPerPixel: 1 -color: kRGB_565_SkColorType bytesPerPixel: 2 -color: kARGB_4444_SkColorType bytesPerPixel: 2 -color: kRGBA_8888_SkColorType bytesPerPixel: 4 -color: kBGRA_8888_SkColorType bytesPerPixel: 4 -color: kGray_8_SkColorType bytesPerPixel: 1 +color: kUnknown_SkColorType bytesPerPixel: 0
+color: kAlpha_8_SkColorType bytesPerPixel: 1
+color: kRGB_565_SkColorType bytesPerPixel: 2
+color: kARGB_4444_SkColorType bytesPerPixel: 2
+color: kRGBA_8888_SkColorType bytesPerPixel: 4
+color: kRGB_888x_SkColorType bytesPerPixel: 4
+color: kBGRA_8888_SkColorType bytesPerPixel: 4
+color: kRGBA_1010102_SkColorType bytesPerPixel: 4
+color: kRGB_101010x_SkColorType bytesPerPixel: 4
+color: kGray_8_SkColorType bytesPerPixel: 1
color: kRGBA_F16_SkColorType bytesPerPixel: 8 ## ## @@ -704,24 +702,25 @@ Returns zero for kUnknown_SkColorType. "BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"}; SkImageInfo info = SkImageInfo::MakeA8(1, 1); SkBitmap bitmap; - for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType, - kRGB_565_SkColorType, kARGB_4444_SkColorType, - kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, - kGray_8_SkColorType, kRGBA_F16_SkColorType } ) { + for (SkColorType colorType : { #list_of_color_types# + } ) { bitmap.setInfo(info.makeColorType(colorType)); SkDebugf("color: k" "%s" "_SkColorType" "%*s" "shiftPerPixel: %d\n", - colors[colorType], 10 - strlen(colors[colorType]), " ", + colors[colorType], 14 - strlen(colors[colorType]), " ", bitmap.shiftPerPixel()); } #StdOut -color: kUnknown_SkColorType shiftPerPixel: 0 -color: kAlpha_8_SkColorType shiftPerPixel: 0 -color: kRGB_565_SkColorType shiftPerPixel: 1 -color: kARGB_4444_SkColorType shiftPerPixel: 1 -color: kRGBA_8888_SkColorType shiftPerPixel: 2 -color: kBGRA_8888_SkColorType shiftPerPixel: 2 -color: kGray_8_SkColorType shiftPerPixel: 0 -color: kRGBA_F16_SkColorType shiftPerPixel: 3 +color: kUnknown_SkColorType shiftPerPixel: 0
+color: kAlpha_8_SkColorType shiftPerPixel: 0
+color: kRGB_565_SkColorType shiftPerPixel: 1
+color: kARGB_4444_SkColorType shiftPerPixel: 1
+color: kRGBA_8888_SkColorType shiftPerPixel: 2
+color: kRGB_888x_SkColorType shiftPerPixel: 2
+color: kBGRA_8888_SkColorType shiftPerPixel: 2
+color: kRGBA_1010102_SkColorType shiftPerPixel: 2
+color: kRGB_101010x_SkColorType shiftPerPixel: 2
+color: kGray_8_SkColorType shiftPerPixel: 0
+color: kRGBA_F16_SkColorType shiftPerPixel: 3 ## ## @@ -900,9 +899,8 @@ void draw(SkCanvas* canvas) { SkAlphaType alphaTypes[] = { kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType, kUnpremul_SkAlphaType }; SkDebugf("%88s", "Canonical Unknown Opaque Premul Unpremul\n"); - for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType, - kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, - kGray_8_SkColorType, kRGBA_F16_SkColorType } ) { + for (SkColorType colorType : { #list_of_color_types# + } ) { for (SkAlphaType canonicalAlphaType : alphaTypes) { SkColorTypeValidateAlphaType(colorType, kUnknown_SkAlphaType, &canonicalAlphaType ); SkDebugf("%10s %10s ", colors[(int) colorType], alphas[(int) canonicalAlphaType ]); diff --git a/docs/SkImageInfo_Reference.bmh b/docs/SkImageInfo_Reference.bmh index 38e5a6d736..e2dbc4ae1a 100644 --- a/docs/SkImageInfo_Reference.bmh +++ b/docs/SkImageInfo_Reference.bmh @@ -194,6 +194,13 @@ in the same order. #Alias Color_Type #Alias Color_Types +#PhraseDef list_of_color_types +kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType, +kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kRGB_888x_SkColorType, +kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, kRGB_101010x_SkColorType, +kGray_8_SkColorType, kRGBA_F16_SkColorType +## + #Subtopic Native #Alias Native_Color_Type #Substitute native SkColorType @@ -759,8 +766,14 @@ range. See http://en.wikipedia.org/wiki/Rec._709 for details. #Struct SkImageInfo -Describes Image dimensions and pixel type. -Used for both source images and render-targets (surfaces). +Describes pixel dimensions and encoding. Bitmap, Image, PixMap, and Surface +can be created from Image_Info. Image_Info can be retrieved from Bitmap and +Pixmap, but not from Image and Surface. For example, Image and Surface +implementations may defer pixel depth, so may not completely specify Image_Info. + +Image_Info contains dimensions, the pixel integral width and height. It encodes +how pixel bits describe Color_Alpha, transparency; Color components red, blue, +and green; and Color_Space, the range and linearity of colors. #Subtopic Member_Function #Populate @@ -775,18 +788,33 @@ Used for both source images and render-targets (surfaces). #Populate ## - #Method SkImageInfo() #In Constructor #Line # creates with zero dimensions, kUnknown_SkColorType, kUnknown_SkAlphaType ## -#Return incomplete ## +Creates an empty Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType, +a width and height of zero, and no Color_Space. + +#Return empty Image_Info ## #Example -// incomplete +#Height 32 +#Description +An empty Image_Info may be passed to SkCanvas::accessTopLayerPixels as storage +for the Canvas actual Image_Info. +## + SkImageInfo imageInfo; + size_t rowBytes; + SkIPoint origin; + uint32_t* access = (uint32_t*) canvas->accessTopLayerPixels(&imageInfo, &rowBytes, &origin); + const char* alphaType[] = { "Unknown", "Opaque", "Premul", "Unpremul" }; + SkString string; + string.printf("k%s_SkAlphaType", alphaType[(int) imageInfo.alphaType()]); + SkPaint paint; + canvas->drawString(string, 20, 20, paint); ## -#SeeAlso incomplete +#SeeAlso Make MakeN32 MakeS32 MakeA8 #Method ## @@ -796,20 +824,42 @@ Used for both source images and render-targets (surfaces). sk_sp<SkColorSpace> cs = nullptr) #In Constructor #Line # creates Image_Info from dimensions, Color_Type, Alpha_Type, Color_Space ## +Creates Image_Info from integral dimensions width and height, Color_Type ct, +Alpha_Type at, and optionally Color_Space cs. -#Param width incomplete ## -#Param height incomplete ## -#Param ct incomplete ## -#Param at incomplete ## -#Param cs incomplete ## +If Color_Space cs is nullptr and Image_Info is part of drawing source: Color_Space +defaults to sRGB, mapping into Surface Color_Space. -#Return incomplete ## +Parameters are not validated to see if their values are legal, or that the +combination is supported. + +#Param width pixel column count; must be zero or greater ## +#Param height pixel row count; must be zero or greater ## +#Param ct one of: #list_of_color_types# +## +#Param at one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType, + kUnpremul_SkAlphaType +## +#Param cs range of colors; may be nullptr ## + +#Return created Image_Info ## #Example -// incomplete +#Height 48 + uint8_t storage[][5] = {{ 0xCA, 0xDA, 0xCA, 0xC9, 0xA3 }, + { 0xAC, 0xA8, 0x89, 0xA7, 0x87 }, + { 0x9B, 0xB5, 0xE5, 0x95, 0x46 }, + { 0x90, 0x81, 0xC5, 0x71, 0x33 }, + { 0x75, 0x55, 0x44, 0x40, 0x30 }}; + SkImageInfo imageInfo = SkImageInfo::Make(5, 5, kGray_8_SkColorType, kOpaque_SkAlphaType); + SkPixmap pixmap(imageInfo, storage[0], sizeof(storage) / 5); + SkBitmap bitmap; + bitmap.installPixels(pixmap); + canvas->scale(8, 8); + canvas->drawBitmap(bitmap, 0, 0); ## -#SeeAlso incomplete +#SeeAlso MakeN32 MakeN32Premul MakeS32 MakeA8 #Method ## @@ -819,21 +869,38 @@ Used for both source images and render-targets (surfaces). sk_sp<SkColorSpace> cs = nullptr) #In Constructor #Line # creates Image_Info with Native_Color_Type ## +Creates Image_Info from integral dimensions width and height, kN32_SkColorType, +Alpha_Type at, and optionally Color_Space cs. kN32_SkColorType will equal either +kBGRA_8888_SkColorType or kRGBA_8888_SkColorType, whichever is optimal. -Sets Color_Type to kN32_SkColorType. +If Color_Space cs is nullptr and Image_Info is part of drawing source: Color_Space +defaults to sRGB, mapping into Surface Color_Space. -#Param width incomplete ## -#Param height incomplete ## -#Param at incomplete ## -#Param cs incomplete ## +Parameters are not validated to see if their values are legal, or that the +combination is supported. -#Return incomplete ## +#Param width pixel column count; must be zero or greater ## +#Param height pixel row count; must be zero or greater ## +#Param at one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType, + kUnpremul_SkAlphaType +## +#Param cs range of colors; may be nullptr ## + +#Return created Image_Info ## #Example -// incomplete +#Height 128 + SkBitmap bitmap; + bitmap.allocPixels(SkImageInfo::MakeN32(16, 16, kPremul_SkAlphaType)); + SkCanvas offscreen(bitmap); + offscreen.clear(SK_ColorWHITE); + SkPaint paint; + offscreen.drawString("g", 0, 10, paint); + canvas->scale(8, 8); + canvas->drawBitmap(bitmap, 0, 0); ## -#SeeAlso incomplete +#SeeAlso Make MakeN32Premul MakeS32 MakeA8 #Method ## @@ -843,19 +910,54 @@ Sets Color_Type to kN32_SkColorType. #In Constructor #Line # creates Image_Info with Native_Color_Type, sRGB Color_Space ## -Creates Image_Info marked as sRGB with kN32_SkColorType swizzle. +Creates Image_Info from integral dimensions width and height, kN32_SkColorType, +Alpha_Type at, with sRGB Color_Space. -#Param width incomplete ## -#Param height incomplete ## -#Param at incomplete ## +Parameters are not validated to see if their values are legal, or that the +combination is supported. -#Return incomplete ## +#Param width pixel column count; must be zero or greater ## +#Param height pixel row count; must be zero or greater ## +#Param at one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType, + kUnpremul_SkAlphaType +## + +#Return created Image_Info ## #Example -// incomplete +#Set sRGB +#Height 128 +#Description +Top gradient is drawn to offscreen without Color_Space. It is darker than middle +gradient, drawn to offscreen with sRGB Color_Space. Bottom gradient shares bits +with middle, but does not specify the Color_Space in noColorSpaceBitmap. A source +without Color_Space is treated as sRGB; the bottom gradient is identical to the +middle gradient. +## + const int width = 256; + const int height = 32; + SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); + SkColor gradColors[] = { 0xFFAA0055, 0xFF11CC88 }; + SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } }; + SkPaint gradPaint; + gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr, + SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode)); + SkBitmap bitmap; + bitmap.allocPixels(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType)); + SkCanvas offscreen(bitmap); + offscreen.drawRect(SkRect::MakeWH(width, height), gradPaint); + canvas->drawBitmap(bitmap, 0, 0); + bitmap.allocPixels(SkImageInfo::MakeS32(width, height, kPremul_SkAlphaType)); + SkCanvas sRGBOffscreen(bitmap); + sRGBOffscreen.drawRect(SkRect::MakeWH(width, height), gradPaint); + canvas->drawBitmap(bitmap, 0, 48); + SkBitmap noColorSpaceBitmap; + noColorSpaceBitmap.setInfo(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType)); + noColorSpaceBitmap.setPixels(bitmap.getAddr(0, 0)); + canvas->drawBitmap(noColorSpaceBitmap, 0, 96); ## -#SeeAlso incomplete +#SeeAlso Make MakeN32 MakeN32Premul MakeA8 #Method ## @@ -865,19 +967,35 @@ Creates Image_Info marked as sRGB with kN32_SkColorType swizzle. #In Constructor #Line # creates Image_Info with Native_Color_Type, kPremul_SkAlphaType ## -Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. +Creates Image_Info from integral dimensions width and height, kN32_SkColorType, +kPremul_SkAlphaType, with optional Color_Space. -#Param width incomplete ## -#Param height incomplete ## -#Param cs incomplete ## +If Color_Space cs is nullptr and Image_Info is part of drawing source: Color_Space +defaults to sRGB, mapping into Surface Color_Space. -#Return incomplete ## +Parameters are not validated to see if their values are legal, or that the +combination is supported. + +#Param width pixel column count; must be zero or greater ## +#Param height pixel row count; must be zero or greater ## +#Param cs range of colors; may be nullptr ## + +#Return created Image_Info ## #Example -// incomplete + SkBitmap bitmap; + bitmap.allocPixels(SkImageInfo::MakeN32Premul(18, 18)); + SkCanvas offscreen(bitmap); + offscreen.clear(SK_ColorWHITE); + SkPaint paint; + paint.setAntiAlias(true); + paint.setTextSize(15); + offscreen.drawString("\xF0\x9F\x98\xB8", 1, 15, paint); + canvas->scale(6, 6); + canvas->drawBitmap(bitmap, 0, 0); ## -#SeeAlso incomplete +#SeeAlso MakeN32 MakeS32 MakeA8 Make #Method ## @@ -886,15 +1004,33 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. #Method static SkImageInfo MakeN32Premul(const SkISize& size) #In Constructor -#Param size incomplete ## +Creates Image_Info from integral dimensions width and height, kN32_SkColorType, +kPremul_SkAlphaType, with Color_Space set to nullptr. -#Return incomplete ## +If Image_Info is part of drawing source: Color_Space defaults to sRGB, mapping +into Surface Color_Space. + +Parameters are not validated to see if their values are legal, or that the +combination is supported. + +#Param size width and height, each must be zero or greater ## + +#Return created Image_Info ## #Example -// incomplete + SkBitmap bitmap; + bitmap.allocPixels(SkImageInfo::MakeN32Premul({18, 18})); + SkCanvas offscreen(bitmap); + offscreen.clear(SK_ColorWHITE); + SkPaint paint; + paint.setAntiAlias(true); + paint.setTextSize(15); + offscreen.drawString("\xF0\x9F\x98\xB9", 1, 15, paint); + canvas->scale(6, 6); + canvas->drawBitmap(bitmap, 0, 0); ## -#SeeAlso incomplete +#SeeAlso MakeN32 MakeS32 MakeA8 Make #Method ## @@ -904,16 +1040,19 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. #In Constructor #Line # creates Image_Info with kAlpha_8_SkColorType, kPremul_SkAlphaType ## -#Param width incomplete ## -#Param height incomplete ## +Creates Image_Info from integral dimensions width and height, kAlpha_8_SkColorType, +kPremul_SkAlphaType, with Color_Space set to nullptr. -#Return incomplete ## +#Param width pixel column count; must be zero or greater ## +#Param height pixel row count; must be zero or greater ## + +#Return created Image_Info ## #Example // incomplete ## -#SeeAlso incomplete +#SeeAlso MakeN32 MakeS32 Make #Method ## @@ -923,16 +1062,29 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. #In Constructor #Line # creates Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType ## -#Param width incomplete ## -#Param height incomplete ## +Creates Image_Info from integral dimensions width and height, kUnknown_SkColorType, +kUnknown_SkAlphaType, with Color_Space set to nullptr. -#Return incomplete ## +Returned Image_Info as part of source does not draw, and as part of destination +can not be drawn to. + +#Param width pixel column count; must be zero or greater ## +#Param height pixel row count; must be zero or greater ## + +#Return created Image_Info ## #Example -// incomplete +#Height 32 +#Width 384 +SkImageInfo info; // default constructor +SkString string; +string.printf("SkImageInfo() %c= SkImageInfo::MakeUnknown(0, 0)", + info == SkImageInfo::MakeUnknown(0, 0) ? '=' : '!'); +SkPaint paint; +canvas->drawString(string, 0, 12, paint); ## -#SeeAlso incomplete +#SeeAlso SkImageInfo() MakeN32 MakeS32 Make #Method ## @@ -941,13 +1093,26 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. #Method static SkImageInfo MakeUnknown() #In Constructor -#Return incomplete ## +Creates Image_Info from integral dimensions width and height set to zero, +kUnknown_SkColorType, kUnknown_SkAlphaType, with Color_Space set to nullptr. + +Returned Image_Info as part of source does not draw, and as part of destination +can not be drawn to. + +#Return created Image_Info ## #Example -// incomplete +#Height 32 +#Width 384 +SkImageInfo info; // default constructor +SkString string; +string.printf("SkImageInfo() %c= SkImageInfo::MakeUnknown()", + info == SkImageInfo::MakeUnknown() ? '=' : '!'); +SkPaint paint; +canvas->drawString(string, 0, 12, paint); ## -#SeeAlso incomplete +#SeeAlso SkImageInfo() MakeN32 MakeS32 Make #Method ## @@ -960,14 +1125,25 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. #Method int width() const #In Property -#Line # incomplete ## -#Return incomplete ## +#Line # returns pixel column count ## +Returns pixel count in each row. + +#Return pixel width ## #Example -// incomplete +#Image 4 +#Height 96 + canvas->translate(10, 10); + canvas->drawBitmap(source, 0, 0); + SkImageInfo imageInfo = source.info(); + canvas->translate(0, imageInfo.height()); + SkPaint paint; + paint.setTextAlign(SkPaint::kCenter_Align); + canvas->drawLine(0, 10, imageInfo.width(), 10, paint); + canvas->drawString("width", imageInfo.width() / 2, 25, paint); ## -#SeeAlso incomplete +#SeeAlso height SkBitmap::width SkPixelRef::width SkImage::width SkSurface::width #Method ## @@ -975,14 +1151,25 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. #Method int height() const #In Property -#Line # incomplete ## -#Return incomplete ## +#Line # returns pixel row count ## +Returns pixel row count. + +#Return pixel height ## #Example -// incomplete +#Image 4 +#Height 96 + canvas->translate(10, 20); + canvas->drawBitmap(source, 0, 0); + SkImageInfo imageInfo = source.info(); + SkPaint paint; + paint.setTextAlign(SkPaint::kCenter_Align); + paint.setVerticalText(true); + canvas->drawLine(imageInfo.width() + 10, 0, imageInfo.width() + 10, imageInfo.height(), paint); + canvas->drawString("height", imageInfo.width() + 25, imageInfo.height() / 2, paint); ## -#SeeAlso incomplete +#SeeAlso width SkBitmap::height SkPixelRef::height SkImage::height SkSurface::height #Method ## @@ -991,7 +1178,9 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. #Method SkColorType colorType() const #In Property #Line # incomplete ## -#Return incomplete ## +Returns Color_Type, one of: #list_of_color_types#. + +#Return Color_Type ## #Example // incomplete diff --git a/docs/SkImage_Reference.bmh b/docs/SkImage_Reference.bmh index 7f5832f241..d11fa1c35f 100644 --- a/docs/SkImage_Reference.bmh +++ b/docs/SkImage_Reference.bmh @@ -392,10 +392,7 @@ Recognized formats vary by GPU back-end. #Param context GPU_Context ## #Param backendTexture texture residing on GPU ## #Param origin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ## -#Param colorType one of: kUnknown_SkColorType, kAlpha_8_SkColorType, - kRGB_565_SkColorType, kARGB_4444_SkColorType, - kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, - kGray_8_SkColorType, kRGBA_F16_SkColorType +#Param colorType one of: #list_of_color_types# ## #Param alphaType one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType, kUnpremul_SkAlphaType @@ -450,10 +447,7 @@ Recognized formats vary by GPU back-end. #Param context GPU_Context ## #Param backendTexture texture residing on GPU ## #Param origin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ## -#Param colorType one of: kUnknown_SkColorType, kAlpha_8_SkColorType, - kRGB_565_SkColorType, kARGB_4444_SkColorType, - kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, - kGray_8_SkColorType, kRGBA_F16_SkColorType +#Param colorType one of: #list_of_color_types# ## #Param alphaType one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType, kUnpremul_SkAlphaType @@ -617,10 +611,7 @@ Recognized formats vary by GPU back-end. #Param context GPU_Context ## #Param backendTexture texture residing on GPU ## #Param surfaceOrigin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ## -#Param colorType one of: kUnknown_SkColorType, kAlpha_8_SkColorType, - kRGB_565_SkColorType, kARGB_4444_SkColorType, - kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, - kGray_8_SkColorType, kRGBA_F16_SkColorType +#Param colorType one of: #list_of_color_types# ## #Param alphaType one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType, kUnpremul_SkAlphaType diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh index 6a40f752cc..323ced5b7c 100644 --- a/docs/SkPaint_Reference.bmh +++ b/docs/SkPaint_Reference.bmh @@ -5099,7 +5099,8 @@ Paint may draw to. #Method bool canComputeFastBounds() const #In Fast_Bounds -#Line # returns true if settings allow for fast bounds computation ###Private +#Line # returns true if settings allow for fast bounds computation ## + #Private (to be made private) ## @@ -5113,7 +5114,8 @@ Paint may draw to. #Method const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const #In Fast_Bounds -#Line # returns fill bounds for quick reject tests ###Private +#Line # returns fill bounds for quick reject tests ## + #Private (to be made private) ## @@ -5179,7 +5181,7 @@ Paint may draw to. #Return fast computed bounds ## ## -#Subtopic Fast_Bounds Fast_Bounds ## +#Subtopic Fast_Bounds ## # ------------------------------------------------------------------------------ #Subtopic Utility diff --git a/docs/SkPath_Reference.bmh b/docs/SkPath_Reference.bmh index 0912a45e34..03a51d6428 100644 --- a/docs/SkPath_Reference.bmh +++ b/docs/SkPath_Reference.bmh @@ -2989,6 +2989,7 @@ constructions are converted to Conic data when added to Path. #List ## #Description ## #Function +###$ struct data { const char* name; char super; @@ -3024,7 +3025,7 @@ const char* yna[] = { "no", "yes" }; - +$$$# ## void draw(SkCanvas* canvas) { SkPaint lp; @@ -3657,8 +3658,10 @@ of its geometric bounds. #Example #Function +###$ #define nameValue(fill) { SkPath::fill, #fill } +$$$# ## void draw(SkCanvas* canvas) { struct { @@ -3713,8 +3716,10 @@ Returns equivalent Fill_Type representing Path fill inside its bounds. #Example #Function +###$ #define nameValue(fill) { SkPath::fill, #fill } +$$$# ## void draw(SkCanvas* canvas) { struct { diff --git a/docs/SkPixmap_Reference.bmh b/docs/SkPixmap_Reference.bmh index 7c4326b919..86d89e53d1 100644 --- a/docs/SkPixmap_Reference.bmh +++ b/docs/SkPixmap_Reference.bmh @@ -443,10 +443,7 @@ pixmap height: 32 info height: 32 #In Image_Info_Access #Line # returns Image_Info Color_Type ## -Returns Color_Type, one of: kUnknown_SkColorType, kAlpha_8_SkColorType, -kRGB_565_SkColorType, kARGB_4444_SkColorType, kRGBA_8888_SkColorType, -kRGB_888x_SkColorType, kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, -kRGB_101010x_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType. +Returns Color_Type, one of: #list_of_color_types#. #Return Color_Type in Image_Info ## diff --git a/docs/SkSurface_Reference.bmh b/docs/SkSurface_Reference.bmh index d692eb4c73..fb25e9eaa6 100644 --- a/docs/SkSurface_Reference.bmh +++ b/docs/SkSurface_Reference.bmh @@ -427,10 +427,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. #Param backendTexture texture residing on GPU ## #Param origin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ## #Param sampleCnt samples per pixel, or 0 to disable full scene anti-aliasing ## -#Param colorType one of: kUnknown_SkColorType, kAlpha_8_SkColorType, - kRGB_565_SkColorType, kARGB_4444_SkColorType, - kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, - kGray_8_SkColorType, kRGBA_F16_SkColorType +#Param colorType one of: #list_of_color_types# ## #Param colorSpace range of colors ## #Param surfaceProps LCD striping orientation and setting for device independent @@ -542,10 +539,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. #Param context GPU_Context ## #Param backendRenderTarget GPU intermediate memory buffer ## #Param origin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ## -#Param colorType one of: kUnknown_SkColorType, kAlpha_8_SkColorType, - kRGB_565_SkColorType, kARGB_4444_SkColorType, - kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, - kGray_8_SkColorType, kRGBA_F16_SkColorType +#Param colorType one of: #list_of_color_types# ## #Param colorSpace range of colors ## #Param surfaceProps LCD striping orientation and setting for device independent @@ -653,10 +647,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. #Param backendTexture texture residing on GPU ## #Param origin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ## #Param sampleCnt samples per pixel, or 0 to disable full scene anti-aliasing ## -#Param colorType one of: kUnknown_SkColorType, kAlpha_8_SkColorType, - kRGB_565_SkColorType, kARGB_4444_SkColorType, - kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, - kGray_8_SkColorType, kRGBA_F16_SkColorType +#Param colorType one of: #list_of_color_types# ## #Param colorSpace range of colors ## #Param surfaceProps LCD striping orientation and setting for device independent @@ -1742,11 +1733,11 @@ and the client will still own the semaphores. #Return true if GPU is waiting on semaphores ## -#Example +#NoExample #ToDo this is copy and paste silliness masquerading as an example. Probably need gpu globals and definitely need gpu expertise to make a real example out of this ## -#Platform !fiddle gpu +#Platform gpu #Height 64 SkPaint paint; paint.setTextSize(32); |