Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: include/gpu/GrDrawContext.h

Issue 1454933002: Initial implementation of GPU no filter NinePatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698