OLD | NEW |
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 */ | 171 */ |
172 void saveActiveTraceMarkers(); | 172 void saveActiveTraceMarkers(); |
173 void restoreActiveTraceMarkers(); | 173 void restoreActiveTraceMarkers(); |
174 | 174 |
175 /** | 175 /** |
176 * Copies a pixel rectangle from one surface to another. This call may final
ize | 176 * Copies a pixel rectangle from one surface to another. This call may final
ize |
177 * reserved vertex/index data (as though a draw call was made). The src pixe
ls | 177 * reserved vertex/index data (as though a draw call was made). The src pixe
ls |
178 * copied are specified by srcRect. They are copied to a rect of the same | 178 * copied are specified by srcRect. They are copied to a rect of the same |
179 * size in dst with top left at dstPoint. If the src rect is clipped by the | 179 * size in dst with top left at dstPoint. If the src rect is clipped by the |
180 * src bounds then pixel values in the dst rect corresponding to area clipp
ed | 180 * src bounds then pixel values in the dst rect corresponding to area clipp
ed |
181 * by the src rect are not overwritten. This method can fail and return fals
e | 181 * by the src rect are not overwritten. This method is not guaranteed to suc
ceed |
182 * depending on the type of surface, configs, etc, and the backend-specific | 182 * depending on the type of surface, configs, etc, and the backend-specific |
183 * limitations. If rect is clipped out entirely by the src or dst bounds the
n | 183 * limitations. |
184 * true is returned since there is no actual copy necessary to succeed. | |
185 */ | 184 */ |
186 bool copySurface(GrSurface* dst, | 185 void copySurface(GrSurface* dst, |
187 GrSurface* src, | 186 GrSurface* src, |
188 const SkIRect& srcRect, | 187 const SkIRect& srcRect, |
189 const SkIPoint& dstPoint); | 188 const SkIPoint& dstPoint); |
190 /** | 189 /** |
191 * Function that determines whether a copySurface call would succeed without
actually | |
192 * performing the copy. | |
193 */ | |
194 bool canCopySurface(const GrSurface* dst, | |
195 const GrSurface* src, | |
196 const SkIRect& srcRect, | |
197 const SkIPoint& dstPoint); | |
198 | |
199 /** | |
200 * Release any resources that are cached but not currently in use. This | 190 * 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. | 191 * is intended to give an application some recourse when resources are low. |
202 */ | 192 */ |
203 virtual void purgeResources() {}; | 193 virtual void purgeResources() {}; |
204 | 194 |
205 /////////////////////////////////////////////////////////////////////////// | 195 /////////////////////////////////////////////////////////////////////////// |
206 // Draw execution tracking (for font atlases and other resources) | 196 // Draw execution tracking (for font atlases and other resources) |
207 class DrawToken { | 197 class DrawToken { |
208 public: | 198 public: |
209 DrawToken(GrDrawTarget* drawTarget, uint32_t drawID) : | 199 DrawToken(GrDrawTarget* drawTarget, uint32_t drawID) : |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 virtual bool setupClip(GrPipelineBuilder*, | 368 virtual bool setupClip(GrPipelineBuilder*, |
379 GrPipelineBuilder::AutoRestoreFragmentProcessors*, | 369 GrPipelineBuilder::AutoRestoreFragmentProcessors*, |
380 GrPipelineBuilder::AutoRestoreStencil*, | 370 GrPipelineBuilder::AutoRestoreStencil*, |
381 GrScissorState* scissorState, | 371 GrScissorState* scissorState, |
382 const SkRect* devBounds) override; | 372 const SkRect* devBounds) override; |
383 | 373 |
384 typedef GrDrawTarget INHERITED; | 374 typedef GrDrawTarget INHERITED; |
385 }; | 375 }; |
386 | 376 |
387 #endif | 377 #endif |
OLD | NEW |