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 |
11 #include "GrColor.h" | 11 #include "GrColor.h" |
12 #include "SkRefCnt.h" | 12 #include "SkRefCnt.h" |
13 #include "SkSurfaceProps.h" | 13 #include "SkSurfaceProps.h" |
14 | 14 |
15 class GrClip; | 15 class GrClip; |
16 class GrContext; | 16 class GrContext; |
17 class GrDrawBatch; | 17 class GrDrawBatch; |
18 class GrDrawingManager; | 18 class GrDrawingManager; |
19 class GrDrawTarget; | 19 class GrDrawTarget; |
20 class GrPaint; | 20 class GrPaint; |
21 class GrPathProcessor; | 21 class GrPathProcessor; |
22 class GrPathRange; | 22 class GrPathRange; |
23 class GrPathRangeDraw; | 23 class GrPathRangeDraw; |
24 class GrPipelineBuilder; | 24 class GrPipelineBuilder; |
25 class GrRenderTarget; | 25 class GrRenderTarget; |
26 class GrStrokeInfo; | 26 class GrStrokeInfo; |
27 class GrSurface; | 27 class GrSurface; |
28 class GrTextContext; | 28 class GrTextContext; |
robertphillips
2015/11/18 18:12:06
Do we need this guy ?
joshualitt
2015/11/18 19:07:07
Acknowledged.
| |
29 class SkBitmap; | |
29 class SkDrawFilter; | 30 class SkDrawFilter; |
30 struct SkIPoint; | 31 struct SkIPoint; |
31 struct SkIRect; | 32 struct SkIRect; |
32 class SkMatrix; | 33 class SkMatrix; |
33 class SkPaint; | 34 class SkPaint; |
34 class SkPath; | 35 class SkPath; |
35 struct SkPoint; | 36 struct SkPoint; |
36 struct SkRect; | 37 struct SkRect; |
37 class SkRRect; | 38 class SkRRect; |
38 struct SkRSXform; | 39 struct SkRSXform; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 * @param oval the bounding rect of the oval. | 236 * @param oval the bounding rect of the oval. |
236 * @param strokeInfo the stroke information (width, join, cap) and | 237 * @param strokeInfo the stroke information (width, join, cap) and |
237 * the dash information (intervals, count, phase). | 238 * the dash information (intervals, count, phase). |
238 */ | 239 */ |
239 void drawOval(const GrClip&, | 240 void drawOval(const GrClip&, |
240 const GrPaint& paint, | 241 const GrPaint& paint, |
241 const SkMatrix& viewMatrix, | 242 const SkMatrix& viewMatrix, |
242 const SkRect& oval, | 243 const SkRect& oval, |
243 const GrStrokeInfo& strokeInfo); | 244 const GrStrokeInfo& strokeInfo); |
244 | 245 |
246 /** | |
247 * Draw the image stretched differentially to fit into dst. | |
248 * center is a rect within the image, and logically divides the image | |
249 * into 9 sections (3x3). For example, if the middle pixel of a [5x5] | |
250 * image is the "center", then the center-rect should be [2, 2, 3, 3]. | |
251 * | |
252 * If the dst is >= the image size, then... | |
253 * - The 4 corners are not stretched at all. | |
254 * - The sides are stretched in only one axis. | |
255 * - The center is stretched in both axes. | |
256 * Else, for each axis where dst < image, | |
257 * - The corners shrink proportionally | |
258 * - The sides (along the shrink axis) and center are not drawn | |
259 */ | |
260 void drawImageNine(const GrClip&, | |
261 const GrPaint& paint, | |
262 const SkMatrix& viewMatrix, | |
263 int imageWidth, | |
264 int imageHeight, | |
265 const SkIRect& center, | |
266 const SkRect& dst); | |
245 | 267 |
246 /** | 268 /** |
247 * Draws a batch | 269 * Draws a batch |
248 * | 270 * |
249 * @param paint describes how to color pixels. | 271 * @param paint describes how to color pixels. |
250 * @param batch the batch to draw | 272 * @param batch the batch to draw |
251 */ | 273 */ |
252 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); | 274 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); |
253 | 275 |
254 private: | 276 private: |
(...skipping 22 matching lines...) Expand all Loading... | |
277 | 299 |
278 // In MDB-mode the drawTarget can be closed by some other drawContext that h as picked | 300 // 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'. | 301 // it up. For this reason, the drawTarget should only ever be accessed via ' getDrawTarget'. |
280 GrDrawTarget* fDrawTarget; | 302 GrDrawTarget* fDrawTarget; |
281 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana ger | 303 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana ger |
282 | 304 |
283 SkSurfaceProps fSurfaceProps; | 305 SkSurfaceProps fSurfaceProps; |
284 }; | 306 }; |
285 | 307 |
286 #endif | 308 #endif |
OLD | NEW |