OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrDrawContext_DEFINED | 8 #ifndef GrDrawContext_DEFINED |
9 #define GrDrawContext_DEFINED | 9 #define GrDrawContext_DEFINED |
10 | 10 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 * @param oval the bounding rect of the oval. | 235 * @param oval the bounding rect of the oval. |
236 * @param strokeInfo the stroke information (width, join, cap) and | 236 * @param strokeInfo the stroke information (width, join, cap) and |
237 * the dash information (intervals, count, phase). | 237 * the dash information (intervals, count, phase). |
238 */ | 238 */ |
239 void drawOval(const GrClip&, | 239 void drawOval(const GrClip&, |
240 const GrPaint& paint, | 240 const GrPaint& paint, |
241 const SkMatrix& viewMatrix, | 241 const SkMatrix& viewMatrix, |
242 const SkRect& oval, | 242 const SkRect& oval, |
243 const GrStrokeInfo& strokeInfo); | 243 const GrStrokeInfo& strokeInfo); |
244 | 244 |
| 245 /** |
| 246 * Draw the image stretched differentially to fit into dst. |
| 247 * center is a rect within the image, and logically divides the image |
| 248 * into 9 sections (3x3). For example, if the middle pixel of a [5x5] |
| 249 * image is the "center", then the center-rect should be [2, 2, 3, 3]. |
| 250 * |
| 251 * If the dst is >= the image size, then... |
| 252 * - The 4 corners are not stretched at all. |
| 253 * - The sides are stretched in only one axis. |
| 254 * - The center is stretched in both axes. |
| 255 * Else, for each axis where dst < image, |
| 256 * - The corners shrink proportionally |
| 257 * - The sides (along the shrink axis) and center are not drawn |
| 258 */ |
| 259 void drawImageNine(const GrClip&, |
| 260 const GrPaint& paint, |
| 261 const SkMatrix& viewMatrix, |
| 262 int imageWidth, |
| 263 int imageHeight, |
| 264 const SkIRect& center, |
| 265 const SkRect& dst); |
245 | 266 |
246 /** | 267 /** |
247 * Draws a batch | 268 * Draws a batch |
248 * | 269 * |
249 * @param paint describes how to color pixels. | 270 * @param paint describes how to color pixels. |
250 * @param batch the batch to draw | 271 * @param batch the batch to draw |
251 */ | 272 */ |
252 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); | 273 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); |
253 | 274 |
254 private: | 275 private: |
(...skipping 22 matching lines...) Expand all Loading... |
277 | 298 |
278 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked | 299 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked |
279 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. | 300 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. |
280 GrDrawTarget* fDrawTarget; | 301 GrDrawTarget* fDrawTarget; |
281 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana
ger | 302 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana
ger |
282 | 303 |
283 SkSurfaceProps fSurfaceProps; | 304 SkSurfaceProps fSurfaceProps; |
284 }; | 305 }; |
285 | 306 |
286 #endif | 307 #endif |
OLD | NEW |