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

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

Issue 2255963002: Batched implementation of drawLattice() for GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Speculative reland Created 4 years, 4 months 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 | « bench/DrawLatticeBench.cpp ('k') | include/private/SkTArray.h » ('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 17 matching lines...) Expand all
28 class GrPaint; 28 class GrPaint;
29 class GrPathProcessor; 29 class GrPathProcessor;
30 class GrPipelineBuilder; 30 class GrPipelineBuilder;
31 class GrRenderTarget; 31 class GrRenderTarget;
32 class GrStyle; 32 class GrStyle;
33 class GrSurface; 33 class GrSurface;
34 struct GrUserStencilSettings; 34 struct GrUserStencilSettings;
35 class SkDrawFilter; 35 class SkDrawFilter;
36 struct SkIPoint; 36 struct SkIPoint;
37 struct SkIRect; 37 struct SkIRect;
38 class SkLatticeIter;
38 class SkMatrix; 39 class SkMatrix;
39 class SkPaint; 40 class SkPaint;
40 class SkPath; 41 class SkPath;
41 struct SkPoint; 42 struct SkPoint;
42 struct SkRect; 43 struct SkRect;
43 class SkRRect; 44 class SkRRect;
44 struct SkRSXform; 45 struct SkRSXform;
45 class SkTextBlob; 46 class SkTextBlob;
46 47
47 /* 48 /*
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 * @param oval the bounding rect of the oval. 225 * @param oval the bounding rect of the oval.
225 * @param style style to apply to the oval. Currently path effects a re not allowed. 226 * @param style style to apply to the oval. Currently path effects a re not allowed.
226 */ 227 */
227 void drawOval(const GrClip&, 228 void drawOval(const GrClip&,
228 const GrPaint& paint, 229 const GrPaint& paint,
229 const SkMatrix& viewMatrix, 230 const SkMatrix& viewMatrix,
230 const SkRect& oval, 231 const SkRect& oval,
231 const GrStyle& style); 232 const GrStyle& style);
232 233
233 /** 234 /**
234 * Draw the image stretched differentially to fit into dst. 235 * Draw the image as a set of rects, specified by |iter|.
235 * center is a rect within the image, and logically divides the image
236 * into 9 sections (3x3). For example, if the middle pixel of a [5x5]
237 * image is the "center", then the center-rect should be [2, 2, 3, 3].
238 *
239 * If the dst is >= the image size, then...
240 * - The 4 corners are not stretched at all.
241 * - The sides are stretched in only one axis.
242 * - The center is stretched in both axes.
243 * Else, for each axis where dst < image,
244 * - The corners shrink proportionally
245 * - The sides (along the shrink axis) and center are not drawn
246 */ 236 */
247 void drawImageNine(const GrClip&, 237 void drawImageLattice(const GrClip&,
248 const GrPaint& paint, 238 const GrPaint& paint,
249 const SkMatrix& viewMatrix, 239 const SkMatrix& viewMatrix,
250 int imageWidth, 240 int imageWidth,
251 int imageHeight, 241 int imageHeight,
252 const SkIRect& center, 242 std::unique_ptr<SkLatticeIter> iter,
253 const SkRect& dst); 243 const SkRect& dst);
254 244
255 /** 245 /**
256 * After this returns any pending surface IO will be issued to the backend 3 D API and 246 * After this returns any pending surface IO will be issued to the backend 3 D API and
257 * if the surface has MSAA it will be resolved. 247 * if the surface has MSAA it will be resolved.
258 */ 248 */
259 void prepareForExternalIO(); 249 void prepareForExternalIO();
260 250
261 bool isStencilBufferMultisampled() const { 251 bool isStencilBufferMultisampled() const {
262 return fRenderTarget->isStencilBufferMultisampled(); 252 return fRenderTarget->isStencilBufferMultisampled();
263 } 253 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 361
372 sk_sp<SkColorSpace> fColorSpace; 362 sk_sp<SkColorSpace> fColorSpace;
373 SkSurfaceProps fSurfaceProps; 363 SkSurfaceProps fSurfaceProps;
374 GrAuditTrail* fAuditTrail; 364 GrAuditTrail* fAuditTrail;
375 365
376 // In debug builds we guard against improper thread handling 366 // In debug builds we guard against improper thread handling
377 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) 367 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;)
378 }; 368 };
379 369
380 #endif 370 #endif
OLDNEW
« no previous file with comments | « bench/DrawLatticeBench.cpp ('k') | include/private/SkTArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698