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 | |
9 | |
10 #ifndef GrGpuGL_DEFINED | 8 #ifndef GrGpuGL_DEFINED |
11 #define GrGpuGL_DEFINED | 9 #define GrGpuGL_DEFINED |
12 | 10 |
13 | |
14 #include "GrBinHashKey.h" | 11 #include "GrBinHashKey.h" |
15 #include "GrDrawState.h" | 12 #include "GrDrawState.h" |
16 #include "GrGpu.h" | 13 #include "GrGpu.h" |
17 #include "GrGLContext.h" | 14 #include "GrGLContext.h" |
18 #include "GrGLIndexBuffer.h" | 15 #include "GrGLIndexBuffer.h" |
19 #include "GrGLIRect.h" | 16 #include "GrGLIRect.h" |
20 #include "GrGLProgram.h" | 17 #include "GrGLProgram.h" |
21 #include "GrGLStencilBuffer.h" | 18 #include "GrGLStencilBuffer.h" |
22 #include "GrGLTexture.h" | 19 #include "GrGLTexture.h" |
23 #include "GrGLVertexArray.h" | 20 #include "GrGLVertexArray.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 virtual GrPath* onCreatePath(const SkPath&) SK_OVERRIDE; | 111 virtual GrPath* onCreatePath(const SkPath&) SK_OVERRIDE; |
115 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) SK_OVER
RIDE; | 112 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) SK_OVER
RIDE; |
116 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&) SK_OVERRIDE; | 113 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&) SK_OVERRIDE; |
117 virtual bool createStencilBufferForRenderTarget(GrRenderTarget* rt, | 114 virtual bool createStencilBufferForRenderTarget(GrRenderTarget* rt, |
118 int width, | 115 int width, |
119 int height) SK_OVERRIDE; | 116 int height) SK_OVERRIDE; |
120 virtual bool attachStencilBufferToRenderTarget( | 117 virtual bool attachStencilBufferToRenderTarget( |
121 GrStencilBuffer* sb, | 118 GrStencilBuffer* sb, |
122 GrRenderTarget* rt) SK_OVERRIDE; | 119 GrRenderTarget* rt) SK_OVERRIDE; |
123 | 120 |
124 virtual void onClear(const GrIRect* rect, GrColor color) SK_OVERRIDE; | 121 virtual void onClear(const SkIRect* rect, GrColor color) SK_OVERRIDE; |
125 | 122 |
126 virtual void onForceRenderTargetFlush() SK_OVERRIDE; | 123 virtual void onForceRenderTargetFlush() SK_OVERRIDE; |
127 | 124 |
128 virtual bool onReadPixels(GrRenderTarget* target, | 125 virtual bool onReadPixels(GrRenderTarget* target, |
129 int left, int top, | 126 int left, int top, |
130 int width, int height, | 127 int width, int height, |
131 GrPixelConfig, | 128 GrPixelConfig, |
132 void* buffer, | 129 void* buffer, |
133 size_t rowBytes) SK_OVERRIDE; | 130 size_t rowBytes) SK_OVERRIDE; |
134 | 131 |
135 virtual bool onWriteTexturePixels(GrTexture* texture, | 132 virtual bool onWriteTexturePixels(GrTexture* texture, |
136 int left, int top, int width, int height, | 133 int left, int top, int width, int height, |
137 GrPixelConfig config, const void* buffer, | 134 GrPixelConfig config, const void* buffer, |
138 size_t rowBytes) SK_OVERRIDE; | 135 size_t rowBytes) SK_OVERRIDE; |
139 | 136 |
140 virtual void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE; | 137 virtual void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE; |
141 | 138 |
142 virtual void onGpuDraw(const DrawInfo&) SK_OVERRIDE; | 139 virtual void onGpuDraw(const DrawInfo&) SK_OVERRIDE; |
143 | 140 |
144 virtual void setStencilPathSettings(const GrPath&, | 141 virtual void setStencilPathSettings(const GrPath&, |
145 SkPath::FillType, | 142 SkPath::FillType, |
146 GrStencilSettings* settings) | 143 GrStencilSettings* settings) |
147 SK_OVERRIDE; | 144 SK_OVERRIDE; |
148 virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE; | 145 virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE; |
149 | 146 |
150 virtual void clearStencil() SK_OVERRIDE; | 147 virtual void clearStencil() SK_OVERRIDE; |
151 virtual void clearStencilClip(const GrIRect& rect, | 148 virtual void clearStencilClip(const SkIRect& rect, |
152 bool insideClip) SK_OVERRIDE; | 149 bool insideClip) SK_OVERRIDE; |
153 virtual bool flushGraphicsState(DrawType, const GrDeviceCoordTexture* dstCop
y) SK_OVERRIDE; | 150 virtual bool flushGraphicsState(DrawType, const GrDeviceCoordTexture* dstCop
y) SK_OVERRIDE; |
154 | 151 |
155 // binds texture unit in GL | 152 // binds texture unit in GL |
156 void setTextureUnit(int unitIdx); | 153 void setTextureUnit(int unitIdx); |
157 | 154 |
158 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt
es gives the offset | 155 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt
es gives the offset |
159 // an into the index buffer. It does not account for drawInfo.startIndex() b
ut rather the start | 156 // an into the index buffer. It does not account for drawInfo.startIndex() b
ut rather the start |
160 // index is relative to the returned offset. | 157 // index is relative to the returned offset. |
161 void setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes); | 158 void setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 225 |
229 // determines valid stencil formats | 226 // determines valid stencil formats |
230 void initStencilFormats(); | 227 void initStencilFormats(); |
231 | 228 |
232 // sets a texture unit to use for texture operations other than binding a te
xture to a program. | 229 // sets a texture unit to use for texture operations other than binding a te
xture to a program. |
233 // ensures that such operations don't negatively interact with tracking boun
d textures. | 230 // ensures that such operations don't negatively interact with tracking boun
d textures. |
234 void setScratchTextureUnit(); | 231 void setScratchTextureUnit(); |
235 | 232 |
236 // bound is region that may be modified and therefore has to be resolved. | 233 // bound is region that may be modified and therefore has to be resolved. |
237 // NULL means whole target. Can be an empty rect. | 234 // NULL means whole target. Can be an empty rect. |
238 void flushRenderTarget(const GrIRect* bound); | 235 void flushRenderTarget(const SkIRect* bound); |
239 void flushStencil(DrawType); | 236 void flushStencil(DrawType); |
240 void flushAAState(DrawType); | 237 void flushAAState(DrawType); |
241 | 238 |
242 bool configToGLFormats(GrPixelConfig config, | 239 bool configToGLFormats(GrPixelConfig config, |
243 bool getSizedInternal, | 240 bool getSizedInternal, |
244 GrGLenum* internalFormat, | 241 GrGLenum* internalFormat, |
245 GrGLenum* externalFormat, | 242 GrGLenum* externalFormat, |
246 GrGLenum* externalType); | 243 GrGLenum* externalType); |
247 // helper for onCreateTexture and writeTexturePixels | 244 // helper for onCreateTexture and writeTexturePixels |
248 bool uploadTexData(const GrGLTexture::Desc& desc, | 245 bool uploadTexData(const GrGLTexture::Desc& desc, |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 ///@} | 430 ///@} |
434 | 431 |
435 // we record what stencil format worked last time to hopefully exit early | 432 // we record what stencil format worked last time to hopefully exit early |
436 // from our loop that tries stencil formats and calls check fb status. | 433 // from our loop that tries stencil formats and calls check fb status. |
437 int fLastSuccessfulStencilFmtIdx; | 434 int fLastSuccessfulStencilFmtIdx; |
438 | 435 |
439 typedef GrGpu INHERITED; | 436 typedef GrGpu INHERITED; |
440 }; | 437 }; |
441 | 438 |
442 #endif | 439 #endif |
OLD | NEW |