OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrGpuGL_DEFINED | 8 #ifndef GrGpuGL_DEFINED |
9 #define GrGpuGL_DEFINED | 9 #define GrGpuGL_DEFINED |
10 | 10 |
11 #include "GrBinHashKey.h" | 11 #include "GrBinHashKey.h" |
12 #include "GrDrawState.h" | 12 #include "GrDrawState.h" |
13 #include "GrGLContext.h" | 13 #include "GrGLContext.h" |
14 #include "GrGLIRect.h" | 14 #include "GrGLIRect.h" |
15 #include "GrGLIndexBuffer.h" | 15 #include "GrGLIndexBuffer.h" |
16 #include "GrGLProgram.h" | 16 #include "GrGLProgram.h" |
17 #include "GrGLStencilBuffer.h" | 17 #include "GrGLStencilBuffer.h" |
18 #include "GrGLTexture.h" | 18 #include "GrGLTexture.h" |
19 #include "GrGLVertexArray.h" | 19 #include "GrGLVertexArray.h" |
20 #include "GrGLVertexBuffer.h" | 20 #include "GrGLVertexBuffer.h" |
21 #include "GrGpu.h" | 21 #include "GrGpu.h" |
22 #include "GrTHashTable.h" | 22 #include "GrTHashTable.h" |
23 #include "SkTypes.h" | 23 #include "SkTypes.h" |
24 | 24 |
25 #ifdef SK_DEVELOPER | 25 #ifdef SK_DEVELOPER |
26 #define PROGRAM_CACHE_STATS | 26 #define PROGRAM_CACHE_STATS |
27 #endif | 27 #endif |
28 | 28 |
| 29 class GrGLNameAllocator; |
| 30 |
29 class GrGpuGL : public GrGpu { | 31 class GrGpuGL : public GrGpu { |
30 public: | 32 public: |
31 GrGpuGL(const GrGLContext& ctx, GrContext* context); | 33 GrGpuGL(const GrGLContext& ctx, GrContext* context); |
32 virtual ~GrGpuGL(); | 34 virtual ~GrGpuGL(); |
33 | 35 |
34 const GrGLContext& glContext() const { return fGLContext; } | 36 const GrGLContext& glContext() const { return fGLContext; } |
35 | 37 |
36 const GrGLInterface* glInterface() const { return fGLContext.interface(); } | 38 const GrGLInterface* glInterface() const { return fGLContext.interface(); } |
37 const GrGLContextInfo& ctxInfo() const { return fGLContext; } | 39 const GrGLContextInfo& ctxInfo() const { return fGLContext; } |
38 GrGLStandard glStandard() const { return fGLContext.standard(); } | 40 GrGLStandard glStandard() const { return fGLContext.standard(); } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 101 } |
100 void notifyVertexBufferDelete(GrGLuint id) { | 102 void notifyVertexBufferDelete(GrGLuint id) { |
101 fHWGeometryState.notifyVertexBufferDelete(id); | 103 fHWGeometryState.notifyVertexBufferDelete(id); |
102 } | 104 } |
103 void notifyIndexBufferDelete(GrGLuint id) { | 105 void notifyIndexBufferDelete(GrGLuint id) { |
104 fHWGeometryState.notifyIndexBufferDelete(id); | 106 fHWGeometryState.notifyIndexBufferDelete(id); |
105 } | 107 } |
106 void notifyTextureDelete(GrGLTexture* texture); | 108 void notifyTextureDelete(GrGLTexture* texture); |
107 void notifyRenderTargetDelete(GrRenderTarget* renderTarget); | 109 void notifyRenderTargetDelete(GrRenderTarget* renderTarget); |
108 | 110 |
| 111 // These functions should be used to generate and delete GL path names. They
have their own |
| 112 // allocator that runs on the client side, so they are much faster than goin
g through GenPaths. |
| 113 GrGLuint createGLPathObject(); |
| 114 void deleteGLPathObject(GrGLuint); |
| 115 |
109 protected: | 116 protected: |
110 virtual bool onCopySurface(GrSurface* dst, | 117 virtual bool onCopySurface(GrSurface* dst, |
111 GrSurface* src, | 118 GrSurface* src, |
112 const SkIRect& srcRect, | 119 const SkIRect& srcRect, |
113 const SkIPoint& dstPoint) SK_OVERRIDE; | 120 const SkIPoint& dstPoint) SK_OVERRIDE; |
114 | 121 |
115 virtual bool onCanCopySurface(GrSurface* dst, | 122 virtual bool onCanCopySurface(GrSurface* dst, |
116 GrSurface* src, | 123 GrSurface* src, |
117 const SkIRect& srcRect, | 124 const SkIRect& srcRect, |
118 const SkIPoint& dstPoint) SK_OVERRIDE; | 125 const SkIPoint& dstPoint) SK_OVERRIDE; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 GrGLfloat fCoefficients[3 * 3]; | 459 GrGLfloat fCoefficients[3 * 3]; |
453 }; | 460 }; |
454 int fHWActivePathTexGenSets; | 461 int fHWActivePathTexGenSets; |
455 SkTArray<PathTexGenData, true> fHWPathTexGenSettings; | 462 SkTArray<PathTexGenData, true> fHWPathTexGenSettings; |
456 ///@} | 463 ///@} |
457 | 464 |
458 // we record what stencil format worked last time to hopefully exit early | 465 // we record what stencil format worked last time to hopefully exit early |
459 // from our loop that tries stencil formats and calls check fb status. | 466 // from our loop that tries stencil formats and calls check fb status. |
460 int fLastSuccessfulStencilFmtIdx; | 467 int fLastSuccessfulStencilFmtIdx; |
461 | 468 |
| 469 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator; |
| 470 |
462 typedef GrGpu INHERITED; | 471 typedef GrGpu INHERITED; |
463 }; | 472 }; |
464 | 473 |
465 #endif | 474 #endif |
OLD | NEW |