aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-11-18 13:28:51 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-18 13:28:51 -0800
commit33a5fce6126dc5d3927a71fdc6c35af6f5893fd5 (patch)
tree86dbddbe639d6fb2310e017618c4f5f4f55e9b54 /include
parent39e7aa48d7ca4c144c457374bf0a0dcc0c5be92d (diff)
Initial implementation of GPU no filter NinePatch
TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1454933002
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrDrawContext.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index d55818b6d7..f051ebd994 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -242,6 +242,27 @@ public:
const SkRect& oval,
const GrStrokeInfo& strokeInfo);
+ /**
+ * Draw the image stretched differentially to fit into dst.
+ * center is a rect within the image, and logically divides the image
+ * into 9 sections (3x3). For example, if the middle pixel of a [5x5]
+ * image is the "center", then the center-rect should be [2, 2, 3, 3].
+ *
+ * If the dst is >= the image size, then...
+ * - The 4 corners are not stretched at all.
+ * - The sides are stretched in only one axis.
+ * - The center is stretched in both axes.
+ * Else, for each axis where dst < image,
+ * - The corners shrink proportionally
+ * - The sides (along the shrink axis) and center are not drawn
+ */
+ void drawImageNine(const GrClip&,
+ const GrPaint& paint,
+ const SkMatrix& viewMatrix,
+ int imageWidth,
+ int imageHeight,
+ const SkIRect& center,
+ const SkRect& dst);
/**
* Draws a batch