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

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

Issue 1151283004: Split drawing functionality out of GrContext and into new GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 * Helper function for drawing rects. 110 * Helper function for drawing rects.
111 * 111 *
112 * @param rect the rect to draw 112 * @param rect the rect to draw
113 * @param localRect optional rect that specifies local coords to map onto 113 * @param localRect optional rect that specifies local coords to map onto
114 * rect. If NULL then rect serves as the local coords. 114 * rect. If NULL then rect serves as the local coords.
115 * @param localMatrix Optional local matrix. The local coordinates are speci fied by localRect, 115 * @param localMatrix Optional local matrix. The local coordinates are speci fied by localRect,
116 * or if it is NULL by rect. This matrix applies to the c oordinate implied by 116 * or if it is NULL by rect. This matrix applies to the c oordinate implied by
117 * that rectangle before it is input to GrCoordTransforms that read local 117 * that rectangle before it is input to GrCoordTransforms that read local
118 * coordinates 118 * coordinates
119 */ 119 */
120 void drawRect(GrPipelineBuilder* pipelineBuilder, 120 void drawBWRect(GrPipelineBuilder* pipelineBuilder,
121 GrColor color, 121 GrColor color,
122 const SkMatrix& viewMatrix, 122 const SkMatrix& viewMatrix,
123 const SkRect& rect, 123 const SkRect& rect,
124 const SkRect* localRect, 124 const SkRect* localRect,
125 const SkMatrix* localMatrix); 125 const SkMatrix* localMatrix);
126 126
127 /** 127 /**
128 * Helper for drawRect when the caller doesn't need separate local rects or matrices. 128 * Helper for drawRect when the caller doesn't need separate local rects or matrices.
129 */ 129 */
130 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi ewM, 130 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi ewM,
131 const SkRect& rect) { 131 const SkRect& rect) {
132 this->drawRect(ds, color, viewM, rect, NULL, NULL); 132 this->drawBWRect(ds, color, viewM, rect, NULL, NULL);
133 } 133 }
134 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi ewM, 134 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi ewM,
135 const SkIRect& irect) { 135 const SkIRect& irect) {
136 SkRect rect = SkRect::Make(irect); 136 SkRect rect = SkRect::Make(irect);
137 this->drawRect(ds, color, viewM, rect, NULL, NULL); 137 this->drawBWRect(ds, color, viewM, rect, NULL, NULL);
138 } 138 }
139 139
140 void drawAARect(GrPipelineBuilder* pipelineBuilder,
141 GrColor color,
142 const SkMatrix& viewMatrix,
143 const SkRect& rect,
144 const SkRect& devRect);
140 145
141 /** 146 /**
142 * Clear the passed in render target. Ignores the GrPipelineBuilder and clip . Clears the whole 147 * Clear the passed in render target. Ignores the GrPipelineBuilder and clip . Clears the whole
143 * thing if rect is NULL, otherwise just the rect. If canIgnoreRect is set t hen the entire 148 * thing if rect is NULL, otherwise just the rect. If canIgnoreRect is set t hen the entire
144 * render target can be optionally cleared. 149 * render target can be optionally cleared.
145 */ 150 */
146 void clear(const SkIRect* rect, 151 void clear(const SkIRect* rect,
147 GrColor color, 152 GrColor color,
148 bool canIgnoreRect, 153 bool canIgnoreRect,
149 GrRenderTarget* renderTarget); 154 GrRenderTarget* renderTarget);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 virtual bool setupClip(GrPipelineBuilder*, 366 virtual bool setupClip(GrPipelineBuilder*,
362 GrPipelineBuilder::AutoRestoreFragmentProcessors*, 367 GrPipelineBuilder::AutoRestoreFragmentProcessors*,
363 GrPipelineBuilder::AutoRestoreStencil*, 368 GrPipelineBuilder::AutoRestoreStencil*,
364 GrScissorState* scissorState, 369 GrScissorState* scissorState,
365 const SkRect* devBounds) override; 370 const SkRect* devBounds) override;
366 371
367 typedef GrDrawTarget INHERITED; 372 typedef GrDrawTarget INHERITED;
368 }; 373 };
369 374
370 #endif 375 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698