OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 #ifndef GrDrawTarget_DEFINED | 10 #ifndef GrDrawTarget_DEFINED |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 * src bounds then pixel values in the dst rect corresponding to area clipp
ed | 415 * src bounds then pixel values in the dst rect corresponding to area clipp
ed |
416 * by the src rect are not overwritten. This method can fail and return fals
e | 416 * by the src rect are not overwritten. This method can fail and return fals
e |
417 * depending on the type of surface, configs, etc, and the backend-specific | 417 * depending on the type of surface, configs, etc, and the backend-specific |
418 * limitations. If rect is clipped out entirely by the src or dst bounds the
n | 418 * limitations. If rect is clipped out entirely by the src or dst bounds the
n |
419 * true is returned since there is no actual copy necessary to succeed. | 419 * true is returned since there is no actual copy necessary to succeed. |
420 */ | 420 */ |
421 bool copySurface(GrSurface* dst, | 421 bool copySurface(GrSurface* dst, |
422 GrSurface* src, | 422 GrSurface* src, |
423 const SkIRect& srcRect, | 423 const SkIRect& srcRect, |
424 const SkIPoint& dstPoint); | 424 const SkIPoint& dstPoint); |
| 425 /** |
| 426 * Function that determines whether a copySurface call would succeed without |
| 427 * performing the copy. |
| 428 */ |
| 429 bool canCopySurface(GrSurface* dst, |
| 430 GrSurface* src, |
| 431 const SkIRect& srcRect, |
| 432 const SkIPoint& dstPoint); |
425 | 433 |
426 /** | 434 /** |
427 * Release any resources that are cached but not currently in use. This | 435 * Release any resources that are cached but not currently in use. This |
428 * is intended to give an application some recourse when resources are low. | 436 * is intended to give an application some recourse when resources are low. |
429 */ | 437 */ |
430 virtual void purgeResources() {}; | 438 virtual void purgeResources() {}; |
431 | 439 |
432 /** | 440 /** |
433 * For subclass internal use to invoke a call to onDraw(). See DrawInfo belo
w. | 441 * For subclass internal use to invoke a call to onDraw(). See DrawInfo belo
w. |
434 */ | 442 */ |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 virtual bool onCopySurface(GrSurface* dst, | 647 virtual bool onCopySurface(GrSurface* dst, |
640 GrSurface* src, | 648 GrSurface* src, |
641 const SkIRect& srcRect, | 649 const SkIRect& srcRect, |
642 const SkIPoint& dstPoint); | 650 const SkIPoint& dstPoint); |
643 | 651 |
644 // Called to determine whether an onCopySurface call would succeed or not. T
his is useful for | 652 // Called to determine whether an onCopySurface call would succeed or not. T
his is useful for |
645 // proxy subclasses to test whether the copy would succeed without executing
it yet. Derived | 653 // proxy subclasses to test whether the copy would succeed without executing
it yet. Derived |
646 // classes must keep this consistent with their implementation of onCopySurf
ace(). The inputs | 654 // classes must keep this consistent with their implementation of onCopySurf
ace(). The inputs |
647 // are the same as onCopySurface(), i.e. srcRect and dstPoint are clipped to
be inside the src | 655 // are the same as onCopySurface(), i.e. srcRect and dstPoint are clipped to
be inside the src |
648 // and dst bounds. | 656 // and dst bounds. |
649 virtual bool canCopySurface(GrSurface* dst, | 657 virtual bool onCanCopySurface(GrSurface* dst, |
650 GrSurface* src, | 658 GrSurface* src, |
651 const SkIRect& srcRect, | 659 const SkIRect& srcRect, |
652 const SkIPoint& dstPoint); | 660 const SkIPoint& dstPoint); |
653 | 661 |
654 GrContext* getContext() { return fContext; } | 662 GrContext* getContext() { return fContext; } |
655 const GrContext* getContext() const { return fContext; } | 663 const GrContext* getContext() const { return fContext; } |
656 | 664 |
657 // A subclass may override this function if it wishes to be notified when th
e clip is changed. | 665 // A subclass may override this function if it wishes to be notified when th
e clip is changed. |
658 // The override should call INHERITED::clipWillBeSet(). | 666 // The override should call INHERITED::clipWillBeSet(). |
659 virtual void clipWillBeSet(const GrClipData* clipData); | 667 virtual void clipWillBeSet(const GrClipData* clipData); |
660 | 668 |
661 // subclasses must call this in their destructors to ensure all vertex | 669 // subclasses must call this in their destructors to ensure all vertex |
662 // and index sources have been released (including those held by | 670 // and index sources have been released (including those held by |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 const GrClipData* fClip; | 820 const GrClipData* fClip; |
813 GrDrawState* fDrawState; | 821 GrDrawState* fDrawState; |
814 GrDrawState fDefaultDraw
State; | 822 GrDrawState fDefaultDraw
State; |
815 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. | 823 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. |
816 GrContext* fContext; | 824 GrContext* fContext; |
817 | 825 |
818 typedef GrRefCnt INHERITED; | 826 typedef GrRefCnt INHERITED; |
819 }; | 827 }; |
820 | 828 |
821 #endif | 829 #endif |
OLD | NEW |