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

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

Issue 1142263002: small cleanup of GrAtlas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tidy 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
« no previous file with comments | « src/gpu/GrAtlas.cpp ('k') | src/gpu/GrImmediateDrawTarget.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 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 const GrSurface* src, 195 const GrSurface* src,
196 const SkIRect& srcRect, 196 const SkIRect& srcRect,
197 const SkIPoint& dstPoint); 197 const SkIPoint& dstPoint);
198 198
199 /** 199 /**
200 * Release any resources that are cached but not currently in use. This 200 * Release any resources that are cached but not currently in use. This
201 * is intended to give an application some recourse when resources are low. 201 * is intended to give an application some recourse when resources are low.
202 */ 202 */
203 virtual void purgeResources() {}; 203 virtual void purgeResources() {};
204 204
205 ///////////////////////////////////////////////////////////////////////////
206 // Draw execution tracking (for font atlases and other resources)
207 class DrawToken {
208 public:
209 DrawToken(GrDrawTarget* drawTarget, uint32_t drawID) :
210 fDrawTarget(drawTarget), fDrawID(drawID) {}
211
212 bool isIssued() { return fDrawTarget && fDrawTarget->isIssued(fDrawID); }
213
214 private:
215 GrDrawTarget* fDrawTarget;
216 uint32_t fDrawID; // this may wrap, but we're doing direct compa rison
217 // so that should be okay
218 };
219
220 virtual DrawToken getCurrentDrawToken() { return DrawToken(this, 0); }
221
222 bool programUnitTest(int maxStages); 205 bool programUnitTest(int maxStages);
223 206
224 protected: 207 protected:
225 friend class GrCommandBuilder; // for PipelineInfo 208 friend class GrCommandBuilder; // for PipelineInfo
226 friend class GrInOrderCommandBuilder; // for PipelineInfo 209 friend class GrInOrderCommandBuilder; // for PipelineInfo
227 friend class GrReorderCommandBuilder; // for PipelineInfo 210 friend class GrReorderCommandBuilder; // for PipelineInfo
228 friend class GrTargetCommands; // for PipelineInfo 211 friend class GrTargetCommands; // for PipelineInfo
229 212
230 GrContext* getContext() { return fContext; } 213 GrContext* getContext() { return fContext; }
231 const GrContext* getContext() const { return fContext; } 214 const GrContext* getContext() const { return fContext; }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 virtual bool setupClip(GrPipelineBuilder*, 361 virtual bool setupClip(GrPipelineBuilder*,
379 GrPipelineBuilder::AutoRestoreFragmentProcessors*, 362 GrPipelineBuilder::AutoRestoreFragmentProcessors*,
380 GrPipelineBuilder::AutoRestoreStencil*, 363 GrPipelineBuilder::AutoRestoreStencil*,
381 GrScissorState* scissorState, 364 GrScissorState* scissorState,
382 const SkRect* devBounds) override; 365 const SkRect* devBounds) override;
383 366
384 typedef GrDrawTarget INHERITED; 367 typedef GrDrawTarget INHERITED;
385 }; 368 };
386 369
387 #endif 370 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlas.cpp ('k') | src/gpu/GrImmediateDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698