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 GrContext_DEFINED | 10 #ifndef GrContext_DEFINED |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 const SkStrokeRec& stroke); | 470 const SkStrokeRec& stroke); |
471 | 471 |
472 /////////////////////////////////////////////////////////////////////////// | 472 /////////////////////////////////////////////////////////////////////////// |
473 // Misc. | 473 // Misc. |
474 | 474 |
475 /** | 475 /** |
476 * Flags that affect flush() behavior. | 476 * Flags that affect flush() behavior. |
477 */ | 477 */ |
478 enum FlushBits { | 478 enum FlushBits { |
479 /** | 479 /** |
480 * A client may want Gr to bind a GrRenderTarget in the 3D API so that | |
481 * it can be rendered to directly. However, Gr lazily sets state. Simply | |
482 * calling setRenderTarget() followed by flush() without flags may not | |
483 * bind the render target. This flag forces the context to bind the last | |
484 * set render target in the 3D API. | |
485 */ | |
486 kForceCurrentRenderTarget_FlushBit = 0x1, | |
487 /** | |
488 * A client may reach a point where it has partially rendered a frame | 480 * A client may reach a point where it has partially rendered a frame |
489 * through a GrContext that it knows the user will never see. This flag | 481 * through a GrContext that it knows the user will never see. This flag |
490 * causes the flush to skip submission of deferred content to the 3D API | 482 * causes the flush to skip submission of deferred content to the 3D API |
491 * during the flush. | 483 * during the flush. |
492 */ | 484 */ |
493 kDiscard_FlushBit = 0x2, | 485 kDiscard_FlushBit = 0x2, |
494 }; | 486 }; |
495 | 487 |
496 /** | 488 /** |
497 * Call to ensure all drawing to the context has been issued to the | 489 * Call to ensure all drawing to the context has been issued to the |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 void* fInfo; | 888 void* fInfo; |
897 }; | 889 }; |
898 | 890 |
899 SkTDArray<CleanUpData> fCleanUpData; | 891 SkTDArray<CleanUpData> fCleanUpData; |
900 | 892 |
901 GrContext(); // init must be called after the constructor. | 893 GrContext(); // init must be called after the constructor. |
902 bool init(GrBackend, GrBackendContext); | 894 bool init(GrBackend, GrBackendContext); |
903 | 895 |
904 void setupDrawBuffer(); | 896 void setupDrawBuffer(); |
905 | 897 |
906 void flushDrawBuffer(); | |
907 | |
908 class AutoRestoreEffects; | 898 class AutoRestoreEffects; |
909 /// Sets the paint and returns the target to draw into. The paint can be NUL
L in which case the | 899 /// Sets the paint and returns the target to draw into. The paint can be NUL
L in which case the |
910 /// draw state is left unmodified. | 900 /// draw state is left unmodified. |
911 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects
*); | 901 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects
*); |
912 | 902 |
913 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, | 903 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, |
914 const SkStrokeRec& stroke); | 904 const SkStrokeRec& stroke); |
915 | 905 |
916 GrTexture* createResizedTexture(const GrTextureDesc& desc, | 906 GrTexture* createResizedTexture(const GrTextureDesc& desc, |
917 const GrCacheID& cacheID, | 907 const GrCacheID& cacheID, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 } | 1012 } |
1023 | 1013 |
1024 GrTexture* texture() { return fTexture; } | 1014 GrTexture* texture() { return fTexture; } |
1025 | 1015 |
1026 private: | 1016 private: |
1027 GrContext* fContext; | 1017 GrContext* fContext; |
1028 GrTexture* fTexture; | 1018 GrTexture* fTexture; |
1029 }; | 1019 }; |
1030 | 1020 |
1031 #endif | 1021 #endif |
OLD | NEW |