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

Side by Side Diff: src/gpu/GrDrawTarget.h

Issue 817853002: Remove localcoordchange functions off paint (Closed) Base URL: https://skia.googlesource.com/skia.git@local-matrix-on-gp
Patch Set: bug fix Created 6 years 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
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 GrDrawTarget_DEFINED 8 #ifndef GrDrawTarget_DEFINED
9 #define GrDrawTarget_DEFINED 9 #define GrDrawTarget_DEFINED
10 10
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 * rect. If NULL then rect serves as the local coords. 305 * rect. If NULL then rect serves as the local coords.
306 * @param localMatrix optional matrix applied to localRect. If 306 * @param localMatrix optional matrix applied to localRect. If
307 * srcRect is non-NULL and srcMatrix is non-NULL 307 * srcRect is non-NULL and srcMatrix is non-NULL
308 * then srcRect will be transformed by srcMatrix. 308 * then srcRect will be transformed by srcMatrix.
309 * srcMatrix can be NULL when no srcMatrix is desired. 309 * srcMatrix can be NULL when no srcMatrix is desired.
310 */ 310 */
311 void drawRect(GrDrawState* ds, 311 void drawRect(GrDrawState* ds,
312 GrColor color, 312 GrColor color,
313 const SkRect& rect, 313 const SkRect& rect,
314 const SkRect* localRect, 314 const SkRect* localRect,
315 const SkMatrix* localMatrix) { 315 const SkMatrix* localMatrix,
316 const SkMatrix* primProcLocalMatrix) {
316 AutoGeometryPush agp(this); 317 AutoGeometryPush agp(this);
317 this->onDrawRect(ds, color, rect, localRect, localMatrix); 318 this->onDrawRect(ds, color, rect, localRect, localMatrix, primProcLocalM atrix);
318 } 319 }
319 320
320 /** 321 /**
321 * Helper for drawRect when the caller doesn't need separate local rects or matrices. 322 * Helper for drawRect when the caller doesn't need separate local rects or matrices.
322 */ 323 */
323 void drawSimpleRect(GrDrawState* ds, GrColor color, const SkRect& rect) { 324 void drawSimpleRect(GrDrawState* ds, GrColor color, const SkRect& rect) {
324 this->drawRect(ds, color, rect, NULL, NULL); 325 this->drawRect(ds, color, rect, NULL, NULL, NULL);
325 } 326 }
326 void drawSimpleRect(GrDrawState* ds, GrColor color, const SkIRect& irect) { 327 void drawSimpleRect(GrDrawState* ds, GrColor color, const SkIRect& irect) {
327 SkRect rect = SkRect::Make(irect); 328 SkRect rect = SkRect::Make(irect);
328 this->drawRect(ds, color, rect, NULL, NULL); 329 this->drawRect(ds, color, rect, NULL, NULL, NULL);
329 } 330 }
330 331
331 /** 332 /**
332 * This call is used to draw multiple instances of some geometry with a 333 * This call is used to draw multiple instances of some geometry with a
333 * given number of vertices (V) and indices (I) per-instance. The indices in 334 * given number of vertices (V) and indices (I) per-instance. The indices in
334 * the index source must have the form i[k+I] == i[k] + V. Also, all indices 335 * the index source must have the form i[k+I] == i[k] + V. Also, all indices
335 * i[kI] ... i[(k+1)I-1] must be elements of the range kV ... (k+1)V-1. As a 336 * i[kI] ... i[(k+1)I-1] must be elements of the range kV ... (k+1)V-1. As a
336 * concrete example, the following index buffer for drawing a series of 337 * concrete example, the following index buffer for drawing a series of
337 * quads each as two triangles each satisfies these conditions with V=4 and 338 * quads each as two triangles each satisfies these conditions with V=4 and
338 * I=6: 339 * I=6:
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 virtual void onDraw(const GrDrawState&, 703 virtual void onDraw(const GrDrawState&,
703 const GrGeometryProcessor*, 704 const GrGeometryProcessor*,
704 const DrawInfo&, 705 const DrawInfo&,
705 const GrScissorState&, 706 const GrScissorState&,
706 const GrDeviceCoordTexture* dstCopy) = 0; 707 const GrDeviceCoordTexture* dstCopy) = 0;
707 // TODO copy in order drawbuffer onDrawRect to here 708 // TODO copy in order drawbuffer onDrawRect to here
708 virtual void onDrawRect(GrDrawState*, 709 virtual void onDrawRect(GrDrawState*,
709 GrColor color, 710 GrColor color,
710 const SkRect& rect, 711 const SkRect& rect,
711 const SkRect* localRect, 712 const SkRect* localRect,
712 const SkMatrix* localMatrix) = 0; 713 const SkMatrix* localMatrix,
714 const SkMatrix* primProcLocalMatrix) = 0;
713 715
714 virtual void onStencilPath(const GrDrawState&, 716 virtual void onStencilPath(const GrDrawState&,
715 const GrPathProcessor*, 717 const GrPathProcessor*,
716 const GrPath*, 718 const GrPath*,
717 const GrScissorState&, 719 const GrScissorState&,
718 const GrStencilSettings&) = 0; 720 const GrStencilSettings&) = 0;
719 virtual void onDrawPath(const GrDrawState&, 721 virtual void onDrawPath(const GrDrawState&,
720 const GrPathProcessor*, 722 const GrPathProcessor*,
721 const GrPath*, 723 const GrPath*,
722 const GrScissorState&, 724 const GrScissorState&,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 virtual bool setupClip(const SkRect* devBounds, 851 virtual bool setupClip(const SkRect* devBounds,
850 GrDrawState::AutoRestoreEffects* are, 852 GrDrawState::AutoRestoreEffects* are,
851 GrDrawState::AutoRestoreStencil* ars, 853 GrDrawState::AutoRestoreStencil* ars,
852 GrDrawState*, 854 GrDrawState*,
853 GrScissorState* scissorState) SK_OVERRIDE; 855 GrScissorState* scissorState) SK_OVERRIDE;
854 856
855 typedef GrDrawTarget INHERITED; 857 typedef GrDrawTarget INHERITED;
856 }; 858 };
857 859
858 #endif 860 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698