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 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 GrGLenum* externalFormat, | 267 GrGLenum* externalFormat, |
268 GrGLenum* externalType); | 268 GrGLenum* externalType); |
269 // helper for onCreateTexture and writeTexturePixels | 269 // helper for onCreateTexture and writeTexturePixels |
270 bool uploadTexData(const GrGLTexture::Desc& desc, | 270 bool uploadTexData(const GrGLTexture::Desc& desc, |
271 bool isNewTexture, | 271 bool isNewTexture, |
272 int left, int top, int width, int height, | 272 int left, int top, int width, int height, |
273 GrPixelConfig dataConfig, | 273 GrPixelConfig dataConfig, |
274 const void* data, | 274 const void* data, |
275 size_t rowBytes); | 275 size_t rowBytes); |
276 | 276 |
277 // helper for onCreateCompressedTexture | 277 // helper for onCreateCompressedTexture. If width and height are |
| 278 // set to -1, then this function will use desc.fWidth and desc.fHeight |
| 279 // for the size of the data. The isNewTexture flag should be set to true |
| 280 // whenever a new texture needs to be created. Otherwise, we assume that |
| 281 // the texture is already in GPU memory and that it's going to be updated |
| 282 // with new data. |
278 bool uploadCompressedTexData(const GrGLTexture::Desc& desc, | 283 bool uploadCompressedTexData(const GrGLTexture::Desc& desc, |
279 const void* data); | 284 const void* data, |
| 285 bool isNewTexture = true, |
| 286 int left = 0, int top = 0, |
| 287 int width = -1, int height = -1); |
280 | 288 |
281 bool createRenderTargetObjects(int width, int height, | 289 bool createRenderTargetObjects(int width, int height, |
282 GrGLuint texID, | 290 GrGLuint texID, |
283 GrGLRenderTarget::Desc* desc); | 291 GrGLRenderTarget::Desc* desc); |
284 | 292 |
285 GrGLContext fGLContext; | 293 GrGLContext fGLContext; |
286 | 294 |
287 // GL program-related state | 295 // GL program-related state |
288 ProgramCache* fProgramCache; | 296 ProgramCache* fProgramCache; |
289 SkAutoTUnref<GrGLProgram> fCurrentProgram; | 297 SkAutoTUnref<GrGLProgram> fCurrentProgram; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 // we record what stencil format worked last time to hopefully exit early | 479 // we record what stencil format worked last time to hopefully exit early |
472 // from our loop that tries stencil formats and calls check fb status. | 480 // from our loop that tries stencil formats and calls check fb status. |
473 int fLastSuccessfulStencilFmtIdx; | 481 int fLastSuccessfulStencilFmtIdx; |
474 | 482 |
475 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator; | 483 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator; |
476 | 484 |
477 typedef GrGpu INHERITED; | 485 typedef GrGpu INHERITED; |
478 }; | 486 }; |
479 | 487 |
480 #endif | 488 #endif |
OLD | NEW |