Chromium Code Reviews| 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 848 // Functions intended for internal use only. | 848 // Functions intended for internal use only. |
| 849 GrGpu* getGpu() { return fGpu; } | 849 GrGpu* getGpu() { return fGpu; } |
| 850 const GrGpu* getGpu() const { return fGpu; } | 850 const GrGpu* getGpu() const { return fGpu; } |
| 851 GrFontCache* getFontCache() { return fFontCache; } | 851 GrFontCache* getFontCache() { return fFontCache; } |
| 852 GrDrawTarget* getTextTarget(); | 852 GrDrawTarget* getTextTarget(); |
| 853 const GrIndexBuffer* getQuadIndexBuffer() const; | 853 const GrIndexBuffer* getQuadIndexBuffer() const; |
| 854 | 854 |
| 855 // Called by tests that draw directly to the context via GrDrawTarget | 855 // Called by tests that draw directly to the context via GrDrawTarget |
| 856 void getTestTarget(GrTestTarget*); | 856 void getTestTarget(GrTestTarget*); |
| 857 | 857 |
| 858 // Functions for managing gpu trace markers | |
| 859 bool gpuTracingEnabled() const { return fGpuTracingEnabled; } | |
|
bsalomon
2014/03/17 17:50:38
Can we make it isGpuTracingEnabled()?
| |
| 860 void turnOnGpuTracing() { fGpuTracingEnabled = true; } | |
| 861 void turnOffGpuTracing() { fGpuTracingEnabled = false; } | |
| 862 | |
| 858 /** | 863 /** |
| 859 * Stencil buffers add themselves to the cache using addStencilBuffer. findS tencilBuffer is | 864 * Stencil buffers add themselves to the cache using addStencilBuffer. findS tencilBuffer is |
| 860 * called to check the cache for a SB that matches an RT's criteria. | 865 * called to check the cache for a SB that matches an RT's criteria. |
| 861 */ | 866 */ |
| 862 void addStencilBuffer(GrStencilBuffer* sb); | 867 void addStencilBuffer(GrStencilBuffer* sb); |
| 863 GrStencilBuffer* findStencilBuffer(int width, int height, int sampleCnt); | 868 GrStencilBuffer* findStencilBuffer(int width, int height, int sampleCnt); |
| 864 | 869 |
| 865 GrPathRenderer* getPathRenderer( | 870 GrPathRenderer* getPathRenderer( |
| 866 const SkPath& path, | 871 const SkPath& path, |
| 867 const SkStrokeRec& stroke, | 872 const SkStrokeRec& stroke, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 911 | 916 |
| 912 struct CleanUpData { | 917 struct CleanUpData { |
| 913 PFCleanUpFunc fFunc; | 918 PFCleanUpFunc fFunc; |
| 914 void* fInfo; | 919 void* fInfo; |
| 915 }; | 920 }; |
| 916 | 921 |
| 917 SkTDArray<CleanUpData> fCleanUpData; | 922 SkTDArray<CleanUpData> fCleanUpData; |
| 918 | 923 |
| 919 int fMaxTextureSizeOverride; | 924 int fMaxTextureSizeOverride; |
| 920 | 925 |
| 926 bool fGpuTracingEnabled; | |
| 927 | |
| 921 GrContext(); // init must be called after the constructor. | 928 GrContext(); // init must be called after the constructor. |
| 922 bool init(GrBackend, GrBackendContext); | 929 bool init(GrBackend, GrBackendContext); |
| 923 | 930 |
| 924 void setupDrawBuffer(); | 931 void setupDrawBuffer(); |
| 925 | 932 |
| 926 class AutoRestoreEffects; | 933 class AutoRestoreEffects; |
| 927 class AutoCheckFlush; | 934 class AutoCheckFlush; |
| 928 /// Sets the paint and returns the target to draw into. The paint can be NUL L in which case the | 935 /// Sets the paint and returns the target to draw into. The paint can be NUL L in which case the |
| 929 /// draw state is left unmodified. | 936 /// draw state is left unmodified. |
| 930 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects *, AutoCheckFlush*); | 937 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects *, AutoCheckFlush*); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1057 } | 1064 } |
| 1058 | 1065 |
| 1059 GrTexture* texture() { return fTexture; } | 1066 GrTexture* texture() { return fTexture; } |
| 1060 | 1067 |
| 1061 private: | 1068 private: |
| 1062 GrContext* fContext; | 1069 GrContext* fContext; |
| 1063 GrTexture* fTexture; | 1070 GrTexture* fTexture; |
| 1064 }; | 1071 }; |
| 1065 | 1072 |
| 1066 #endif | 1073 #endif |
| OLD | NEW |