OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 * This plays the queued up draws to its GrGpu target. It also resets this o
bject (i.e. flushing | 62 * This plays the queued up draws to its GrGpu target. It also resets this o
bject (i.e. flushing |
63 * is destructive). This buffer must not have an active reserved vertex or i
ndex source. Any | 63 * is destructive). This buffer must not have an active reserved vertex or i
ndex source. Any |
64 * reserved geometry on the target will be finalized because it's geometry s
ource will be pushed | 64 * reserved geometry on the target will be finalized because it's geometry s
ource will be pushed |
65 * before flushing and popped afterwards. | 65 * before flushing and popped afterwards. |
66 */ | 66 */ |
67 void flush(); | 67 void flush(); |
68 | 68 |
69 // overrides from GrDrawTarget | 69 // overrides from GrDrawTarget |
70 virtual bool geometryHints(int* vertexCount, | 70 virtual bool geometryHints(int* vertexCount, |
71 int* indexCount) const SK_OVERRIDE; | 71 int* indexCount) const SK_OVERRIDE; |
72 virtual void clear(const GrIRect* rect, | 72 virtual void clear(const SkIRect* rect, |
73 GrColor color, | 73 GrColor color, |
74 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; | 74 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; |
75 | 75 |
76 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des
c) SK_OVERRIDE; | 76 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des
c) SK_OVERRIDE; |
77 | 77 |
78 | 78 |
79 protected: | 79 protected: |
80 virtual void clipWillBeSet(const GrClipData* newClip) SK_OVERRIDE; | 80 virtual void clipWillBeSet(const GrClipData* newClip) SK_OVERRIDE; |
81 | 81 |
82 private: | 82 private: |
(...skipping 18 matching lines...) Expand all Loading... |
101 | 101 |
102 SkAutoTUnref<const GrPath> fPath; | 102 SkAutoTUnref<const GrPath> fPath; |
103 SkStrokeRec fStroke; | 103 SkStrokeRec fStroke; |
104 SkPath::FillType fFill; | 104 SkPath::FillType fFill; |
105 }; | 105 }; |
106 | 106 |
107 struct Clear : GrNoncopyable { | 107 struct Clear : GrNoncopyable { |
108 Clear() : fRenderTarget(NULL) {} | 108 Clear() : fRenderTarget(NULL) {} |
109 ~Clear() { GrSafeUnref(fRenderTarget); } | 109 ~Clear() { GrSafeUnref(fRenderTarget); } |
110 | 110 |
111 GrIRect fRect; | 111 SkIRect fRect; |
112 GrColor fColor; | 112 GrColor fColor; |
113 GrRenderTarget* fRenderTarget; | 113 GrRenderTarget* fRenderTarget; |
114 }; | 114 }; |
115 | 115 |
116 struct CopySurface : GrNoncopyable { | 116 struct CopySurface : GrNoncopyable { |
117 SkAutoTUnref<GrSurface> fDst; | 117 SkAutoTUnref<GrSurface> fDst; |
118 SkAutoTUnref<GrSurface> fSrc; | 118 SkAutoTUnref<GrSurface> fSrc; |
119 SkIRect fSrcRect; | 119 SkIRect fSrcRect; |
120 SkIPoint fDstPoint; | 120 SkIPoint fDstPoint; |
121 }; | 121 }; |
122 | 122 |
123 // overrides from GrDrawTarget | 123 // overrides from GrDrawTarget |
124 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; | 124 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; |
125 virtual void onDrawRect(const GrRect& rect, | 125 virtual void onDrawRect(const SkRect& rect, |
126 const SkMatrix* matrix, | 126 const SkMatrix* matrix, |
127 const GrRect* localRect, | 127 const SkRect* localRect, |
128 const SkMatrix* localMatrix) SK_OVERRIDE; | 128 const SkMatrix* localMatrix) SK_OVERRIDE; |
129 virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath:
:FillType) SK_OVERRIDE; | 129 virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath:
:FillType) SK_OVERRIDE; |
130 virtual bool onReserveVertexSpace(size_t vertexSize, | 130 virtual bool onReserveVertexSpace(size_t vertexSize, |
131 int vertexCount, | 131 int vertexCount, |
132 void** vertices) SK_OVERRIDE; | 132 void** vertices) SK_OVERRIDE; |
133 virtual bool onReserveIndexSpace(int indexCount, | 133 virtual bool onReserveIndexSpace(int indexCount, |
134 void** indices) SK_OVERRIDE; | 134 void** indices) SK_OVERRIDE; |
135 virtual void releaseReservedVertexSpace() SK_OVERRIDE; | 135 virtual void releaseReservedVertexSpace() SK_OVERRIDE; |
136 virtual void releaseReservedIndexSpace() SK_OVERRIDE; | 136 virtual void releaseReservedIndexSpace() SK_OVERRIDE; |
137 virtual void onSetVertexSourceToArray(const void* vertexArray, | 137 virtual void onSetVertexSourceToArray(const void* vertexArray, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 size_t fUsedPoolIndexBytes; | 221 size_t fUsedPoolIndexBytes; |
222 }; | 222 }; |
223 SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack; | 223 SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack; |
224 | 224 |
225 bool fFlushing; | 225 bool fFlushing; |
226 | 226 |
227 typedef GrDrawTarget INHERITED; | 227 typedef GrDrawTarget INHERITED; |
228 }; | 228 }; |
229 | 229 |
230 #endif | 230 #endif |
OLD | NEW |