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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 const GrGpu* getGpu() const { return fGpu; } | 921 const GrGpu* getGpu() const { return fGpu; } |
922 GrFontCache* getFontCache() { return fFontCache; } | 922 GrFontCache* getFontCache() { return fFontCache; } |
923 GrLayerCache* getLayerCache() { return fLayerCache.get(); } | 923 GrLayerCache* getLayerCache() { return fLayerCache.get(); } |
924 GrDrawTarget* getTextTarget(); | 924 GrDrawTarget* getTextTarget(); |
925 const GrIndexBuffer* getQuadIndexBuffer() const; | 925 const GrIndexBuffer* getQuadIndexBuffer() const; |
926 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } | 926 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } |
927 | 927 |
928 // Called by tests that draw directly to the context via GrDrawTarget | 928 // Called by tests that draw directly to the context via GrDrawTarget |
929 void getTestTarget(GrTestTarget*); | 929 void getTestTarget(GrTestTarget*); |
930 | 930 |
931 // Functions for managing gpu trace markers | |
932 bool isGpuTracingEnabled() const { return fGpuTracingEnabled; } | |
933 void enableGpuTracing() { fGpuTracingEnabled = true; } | |
934 void disableGpuTracing() { fGpuTracingEnabled = false; } | |
935 | |
936 void addGpuTraceMarker(const GrGpuTraceMarker* marker); | 931 void addGpuTraceMarker(const GrGpuTraceMarker* marker); |
937 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); | 932 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); |
938 | 933 |
939 /** | 934 /** |
940 * Stencil buffers add themselves to the cache using addStencilBuffer. findS
tencilBuffer is | 935 * Stencil buffers add themselves to the cache using addStencilBuffer. findS
tencilBuffer is |
941 * called to check the cache for a SB that matches an RT's criteria. | 936 * called to check the cache for a SB that matches an RT's criteria. |
942 */ | 937 */ |
943 void addStencilBuffer(GrStencilBuffer* sb); | 938 void addStencilBuffer(GrStencilBuffer* sb); |
944 GrStencilBuffer* findStencilBuffer(int width, int height, int sampleCnt); | 939 GrStencilBuffer* findStencilBuffer(int width, int height, int sampleCnt); |
945 | 940 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 | 987 |
993 struct CleanUpData { | 988 struct CleanUpData { |
994 PFCleanUpFunc fFunc; | 989 PFCleanUpFunc fFunc; |
995 void* fInfo; | 990 void* fInfo; |
996 }; | 991 }; |
997 | 992 |
998 SkTDArray<CleanUpData> fCleanUpData; | 993 SkTDArray<CleanUpData> fCleanUpData; |
999 | 994 |
1000 int fMaxTextureSizeOverride; | 995 int fMaxTextureSizeOverride; |
1001 | 996 |
1002 bool fGpuTracingEnabled; | |
1003 | |
1004 GrContext(); // init must be called after the constructor. | 997 GrContext(); // init must be called after the constructor. |
1005 bool init(GrBackend, GrBackendContext); | 998 bool init(GrBackend, GrBackendContext); |
1006 | 999 |
1007 void setupDrawBuffer(); | 1000 void setupDrawBuffer(); |
1008 | 1001 |
1009 class AutoRestoreEffects; | 1002 class AutoRestoreEffects; |
1010 class AutoCheckFlush; | 1003 class AutoCheckFlush; |
1011 /// Sets the paint and returns the target to draw into. The paint can be NUL
L in which case the | 1004 /// Sets the paint and returns the target to draw into. The paint can be NUL
L in which case the |
1012 /// draw state is left unmodified. | 1005 /// draw state is left unmodified. |
1013 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects
*, AutoCheckFlush*); | 1006 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects
*, AutoCheckFlush*); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 } | 1134 } |
1142 | 1135 |
1143 GrTexture* texture() { return fTexture; } | 1136 GrTexture* texture() { return fTexture; } |
1144 | 1137 |
1145 private: | 1138 private: |
1146 GrContext* fContext; | 1139 GrContext* fContext; |
1147 GrTexture* fTexture; | 1140 GrTexture* fTexture; |
1148 }; | 1141 }; |
1149 | 1142 |
1150 #endif | 1143 #endif |
OLD | NEW |