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

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

Issue 1293563003: Put clear and discard into GrBatch. (Closed) Base URL: https://skia.googlesource.com/skia.git@protectedprepare
Patch Set: tiny Created 5 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 | « src/gpu/GrCommandBuilder.cpp ('k') | src/gpu/GrDrawTarget.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 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 12 matching lines...) Expand all
23 23
24 #include "SkClipStack.h" 24 #include "SkClipStack.h"
25 #include "SkMatrix.h" 25 #include "SkMatrix.h"
26 #include "SkPath.h" 26 #include "SkPath.h"
27 #include "SkStrokeRec.h" 27 #include "SkStrokeRec.h"
28 #include "SkTArray.h" 28 #include "SkTArray.h"
29 #include "SkTLazy.h" 29 #include "SkTLazy.h"
30 #include "SkTypes.h" 30 #include "SkTypes.h"
31 #include "SkXfermode.h" 31 #include "SkXfermode.h"
32 32
33 class GrBatch;
33 class GrClip; 34 class GrClip;
34 class GrCaps; 35 class GrCaps;
35 class GrPath; 36 class GrPath;
36 class GrPathRange; 37 class GrPathRange;
37 class GrDrawBatch; 38 class GrDrawBatch;
38 39
39 class GrDrawTarget : public SkRefCnt { 40 class GrDrawTarget : public SkRefCnt {
40 public: 41 public:
41 42
42 43
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 /** 149 /**
149 * Clear the passed in render target. Ignores the GrPipelineBuilder and clip . Clears the whole 150 * Clear the passed in render target. Ignores the GrPipelineBuilder and clip . Clears the whole
150 * thing if rect is NULL, otherwise just the rect. If canIgnoreRect is set t hen the entire 151 * thing if rect is NULL, otherwise just the rect. If canIgnoreRect is set t hen the entire
151 * render target can be optionally cleared. 152 * render target can be optionally cleared.
152 */ 153 */
153 void clear(const SkIRect* rect, 154 void clear(const SkIRect* rect,
154 GrColor color, 155 GrColor color,
155 bool canIgnoreRect, 156 bool canIgnoreRect,
156 GrRenderTarget* renderTarget); 157 GrRenderTarget* renderTarget);
157 158
158 /** 159 /** Discards the contents render target. */
159 * Discards the contents render target. 160 void discard(GrRenderTarget*);
160 **/
161 virtual void discard(GrRenderTarget*) = 0;
162 161
163 /** 162 /**
164 * Called at start and end of gpu trace marking 163 * Called at start and end of gpu trace marking
165 * GR_CREATE_GPU_TRACE_MARKER(marker_str, target) will automatically call th ese at the start 164 * GR_CREATE_GPU_TRACE_MARKER(marker_str, target) will automatically call th ese at the start
166 * and end of a code block respectively 165 * and end of a code block respectively
167 */ 166 */
168 void addGpuTraceMarker(const GrGpuTraceMarker* marker); 167 void addGpuTraceMarker(const GrGpuTraceMarker* marker);
169 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); 168 void removeGpuTraceMarker(const GrGpuTraceMarker* marker);
170 169
171 /** 170 /**
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 const GrProcOptInfo& colorPOI, 234 const GrProcOptInfo& colorPOI,
236 const GrProcOptInfo& coveragePOI, 235 const GrProcOptInfo& coveragePOI,
237 GrXferProcessor::DstTexture*, 236 GrXferProcessor::DstTexture*,
238 const SkRect* drawBounds); 237 const SkRect* drawBounds);
239 238
240 private: 239 private:
241 virtual void onReset() = 0; 240 virtual void onReset() = 0;
242 241
243 virtual void onFlush() = 0; 242 virtual void onFlush() = 0;
244 243
245 virtual void onDrawBatch(GrDrawBatch*) = 0; 244 virtual void onDrawBatch(GrBatch*) = 0;
246 virtual void onStencilPath(const GrPipelineBuilder&, 245 virtual void onStencilPath(const GrPipelineBuilder&,
247 const GrPathProcessor*, 246 const GrPathProcessor*,
248 const GrPath*, 247 const GrPath*,
249 const GrScissorState&, 248 const GrScissorState&,
250 const GrStencilSettings&) = 0; 249 const GrStencilSettings&) = 0;
251 virtual void onDrawPath(const GrPathProcessor*, 250 virtual void onDrawPath(const GrPathProcessor*,
252 const GrPath*, 251 const GrPath*,
253 const GrStencilSettings&, 252 const GrStencilSettings&,
254 const PipelineInfo&) = 0; 253 const PipelineInfo&) = 0;
255 virtual void onDrawPaths(const GrPathProcessor*, 254 virtual void onDrawPaths(const GrPathProcessor*,
256 const GrPathRange*, 255 const GrPathRange*,
257 const void* indices, 256 const void* indices,
258 PathIndexType, 257 PathIndexType,
259 const float transformValues[], 258 const float transformValues[],
260 PathTransformType, 259 PathTransformType,
261 int count, 260 int count,
262 const GrStencilSettings&, 261 const GrStencilSettings&,
263 const PipelineInfo&) = 0; 262 const PipelineInfo&) = 0;
264 263
265 virtual void onClear(const SkIRect& rect, GrColor color, GrRenderTarget* ren derTarget) = 0;
266
267 /** The subclass's copy surface implementation. It should assume that any cl ipping has already 264 /** The subclass's copy surface implementation. It should assume that any cl ipping has already
268 been performed on the rect and point and that the GrGpu supports the cop y. */ 265 been performed on the rect and point and that the GrGpu supports the cop y. */
269 virtual void onCopySurface(GrSurface* dst, 266 virtual void onCopySurface(GrSurface* dst,
270 GrSurface* src, 267 GrSurface* src,
271 const SkIRect& srcRect, 268 const SkIRect& srcRect,
272 const SkIPoint& dstPoint) = 0; 269 const SkIPoint& dstPoint) = 0;
273 270
274 // Check to see if this set of draw commands has been sent out 271 // Check to see if this set of draw commands has been sent out
275 virtual bool isIssued(uint32_t drawID) { return true; } 272 virtual bool isIssued(uint32_t drawID) { return true; }
276 void getPathStencilSettingsForFilltype(GrPathRendering::FillType, 273 void getPathStencilSettingsForFilltype(GrPathRendering::FillType,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 bool setupClip(const GrPipelineBuilder&, 329 bool setupClip(const GrPipelineBuilder&,
333 GrPipelineBuilder::AutoRestoreFragmentProcessorState*, 330 GrPipelineBuilder::AutoRestoreFragmentProcessorState*,
334 GrPipelineBuilder::AutoRestoreStencil*, 331 GrPipelineBuilder::AutoRestoreStencil*,
335 GrScissorState* scissorState, 332 GrScissorState* scissorState,
336 const SkRect* devBounds) override; 333 const SkRect* devBounds) override;
337 334
338 typedef GrDrawTarget INHERITED; 335 typedef GrDrawTarget INHERITED;
339 }; 336 };
340 337
341 #endif 338 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrCommandBuilder.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698