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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 void incRenderTargetBinds() {} | 934 void incRenderTargetBinds() {} |
935 void incShaderCompilations() {} | 935 void incShaderCompilations() {} |
936 #endif | 936 #endif |
937 }; | 937 }; |
938 | 938 |
939 #if GR_GPU_STATS | 939 #if GR_GPU_STATS |
940 const GPUStats* gpuStats() const; | 940 const GPUStats* gpuStats() const; |
941 #endif | 941 #endif |
942 | 942 |
943 private: | 943 private: |
944 // Used to indicate whether a draw should be performed immediately or queued
in fDrawBuffer. | |
945 enum BufferedDraw { | |
946 kYes_BufferedDraw, | |
947 kNo_BufferedDraw, | |
948 }; | |
949 BufferedDraw fLastDrawWasBuffered; | |
950 | |
951 GrGpu* fGpu; | 944 GrGpu* fGpu; |
952 SkMatrix fViewMatrix; | 945 SkMatrix fViewMatrix; |
953 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 946 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
954 const GrClipData* fClip; // TODO: make this ref counted | 947 const GrClipData* fClip; // TODO: make this ref counted |
955 GrDrawState* fDrawState; | 948 GrDrawState* fDrawState; |
956 | 949 |
957 GrResourceCache* fResourceCache; | 950 GrResourceCache* fResourceCache; |
958 GrResourceCache2* fResourceCache2; | 951 GrResourceCache2* fResourceCache2; |
959 GrFontCache* fFontCache; | 952 GrFontCache* fFontCache; |
960 SkAutoTDelete<GrLayerCache> fLayerCache; | 953 SkAutoTDelete<GrLayerCache> fLayerCache; |
(...skipping 28 matching lines...) Expand all Loading... |
989 | 982 |
990 GrContext(const Options&); // init must be called after the constructor. | 983 GrContext(const Options&); // init must be called after the constructor. |
991 bool init(GrBackend, GrBackendContext); | 984 bool init(GrBackend, GrBackendContext); |
992 | 985 |
993 void setupDrawBuffer(); | 986 void setupDrawBuffer(); |
994 | 987 |
995 class AutoRestoreEffects; | 988 class AutoRestoreEffects; |
996 class AutoCheckFlush; | 989 class AutoCheckFlush; |
997 /// Sets the paint and returns the target to draw into. The paint can be NUL
L in which case the | 990 /// Sets the paint and returns the target to draw into. The paint can be NUL
L in which case the |
998 /// draw state is left unmodified. | 991 /// draw state is left unmodified. |
999 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects
*, AutoCheckFlush*); | 992 GrDrawTarget* prepareToDraw(const GrPaint*, AutoRestoreEffects*, AutoCheckFl
ush*); |
1000 | 993 |
1001 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, | 994 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, |
1002 const GrStrokeInfo& stroke); | 995 const GrStrokeInfo& stroke); |
1003 | 996 |
1004 GrTexture* createResizedTexture(const GrSurfaceDesc& desc, | 997 GrTexture* createResizedTexture(const GrSurfaceDesc& desc, |
1005 const GrCacheID& cacheID, | 998 const GrCacheID& cacheID, |
1006 const void* srcData, | 999 const void* srcData, |
1007 size_t rowBytes, | 1000 size_t rowBytes, |
1008 bool filter); | 1001 bool filter); |
1009 | 1002 |
(...skipping 10 matching lines...) Expand all Loading... |
1020 /** | 1013 /** |
1021 * This callback allows the resource cache to callback into the GrContext | 1014 * This callback allows the resource cache to callback into the GrContext |
1022 * when the cache is still overbudget after a purge. | 1015 * when the cache is still overbudget after a purge. |
1023 */ | 1016 */ |
1024 static bool OverbudgetCB(void* data); | 1017 static bool OverbudgetCB(void* data); |
1025 | 1018 |
1026 typedef SkRefCnt INHERITED; | 1019 typedef SkRefCnt INHERITED; |
1027 }; | 1020 }; |
1028 | 1021 |
1029 #endif | 1022 #endif |
OLD | NEW |