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

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

Issue 1117433002: Remove GrFlushToGpuDrawTarget and move functionality up to GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more 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/GrDrawTarget.cpp ('k') | src/gpu/GrFlushToGpuDrawTarget.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrFlushToGpuDrawTarget_DEFINED
9 #define GrFlushToGpuDrawTarget_DEFINED
10
11 #include "GrDrawTarget.h"
12
13 class GrIndexBufferAllocPool;
14 class GrVertexBufferAllocPool;
15 class GrGpu;
16
17 /**
18 * Base class for draw targets that accumulate index and vertex data in buffers for deferred.
19 * When draw target clients reserve geometry this subclass will place that geome try into
20 * preallocated vertex/index buffers in the order the requests are made (assumin g the requests fit
21 * in the preallocated buffers).
22 */
23 class GrFlushToGpuDrawTarget : public GrClipTarget {
24 public:
25 GrFlushToGpuDrawTarget(GrGpu*, GrVertexBufferAllocPool*,GrIndexBufferAllocPo ol*);
26
27 /**
28 * Empties the draw buffer of any queued up draws. This must not be called w hile inside an
29 * unbalanced pushGeometrySource().
30 */
31 void reset();
32
33 /**
34 * This plays any queued up draws to its GrGpu target. It also resets this o bject (i.e. flushing
35 * is destructive). This buffer must not have an active reserved vertex or i ndex source. Any
36 * reserved geometry on the target will be finalized because it's geometry s ource will be pushed
37 * before flushing and popped afterwards.
38 */
39 void flush();
40
41 protected:
42 GrGpu* getGpu() { return fGpu; }
43 const GrGpu* getGpu() const{ return fGpu; }
44
45 GrVertexBufferAllocPool* getVertexAllocPool() { return fVertexPool; }
46 GrIndexBufferAllocPool* getIndexAllocPool() { return fIndexPool; }
47
48 private:
49 virtual void onReset() = 0;
50
51 virtual void onFlush() = 0;
52
53 bool onCanCopySurface(const GrSurface* dst,
54 const GrSurface* src,
55 const SkIRect& srcRect,
56 const SkIPoint& dstPoint) override;
57 bool onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) ove rride;
58
59 SkAutoTUnref<GrGpu> fGpu;
60 GrVertexBufferAllocPool* fVertexPool;
61 GrIndexBufferAllocPool* fIndexPool;
62 bool fFlushing;
63
64 typedef GrClipTarget INHERITED;
65 };
66
67 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrFlushToGpuDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698