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 GrGLGpu_DEFINED | 8 #ifndef GrGLGpu_DEFINED |
9 #define GrGLGpu_DEFINED | 9 #define GrGLGpu_DEFINED |
10 | 10 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 // with new data. | 276 // with new data. |
277 bool uploadCompressedTexData(const GrSurfaceDesc& desc, | 277 bool uploadCompressedTexData(const GrSurfaceDesc& desc, |
278 const void* data, | 278 const void* data, |
279 bool isNewTexture = true, | 279 bool isNewTexture = true, |
280 int left = 0, int top = 0, | 280 int left = 0, int top = 0, |
281 int width = -1, int height = -1); | 281 int width = -1, int height = -1); |
282 | 282 |
283 bool createRenderTargetObjects(const GrSurfaceDesc&, bool budgeted, GrGLuint texID, | 283 bool createRenderTargetObjects(const GrSurfaceDesc&, bool budgeted, GrGLuint texID, |
284 GrGLRenderTarget::IDDesc*); | 284 GrGLRenderTarget::IDDesc*); |
285 | 285 |
286 GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport); | 286 enum TempFBOTarget { |
287 kSrc_TempFBOTarget, | |
288 kDst_TempFBOTarget | |
289 }; | |
290 | |
291 GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport, | |
292 TempFBOTarget tempFBOTarget); | |
293 | |
294 void unbindTextureFromFBO(GrGLenum fboTarget); | |
287 | 295 |
288 GrGLContext fGLContext; | 296 GrGLContext fGLContext; |
289 | 297 |
290 // GL program-related state | 298 // GL program-related state |
291 ProgramCache* fProgramCache; | 299 ProgramCache* fProgramCache; |
292 SkAutoTUnref<GrGLProgram> fCurrentProgram; | 300 SkAutoTUnref<GrGLProgram> fCurrentProgram; |
293 | 301 |
294 /////////////////////////////////////////////////////////////////////////// | 302 /////////////////////////////////////////////////////////////////////////// |
295 ///@name Caching of GL State | 303 ///@name Caching of GL State |
296 ///@{ | 304 ///@{ |
297 int fHWActiveTextureUnitIdx; | 305 int fHWActiveTextureUnitIdx; |
298 GrGLuint fHWProgramID; | 306 GrGLuint fHWProgramID; |
299 | 307 |
300 enum TriState { | 308 enum TriState { |
301 kNo_TriState, | 309 kNo_TriState, |
302 kYes_TriState, | 310 kYes_TriState, |
303 kUnknown_TriState | 311 kUnknown_TriState |
304 }; | 312 }; |
305 | 313 |
314 // Temp FBOs | |
315 struct TempFBO { | |
bsalomon
2015/02/02 21:33:01
Maybe it'd be better to just have explicit calls i
| |
316 explicit TempFBO(GrGLGpu* gpu) : fID(0), fGpu(gpu) {} | |
317 ~TempFBO() { | |
318 if (0 != fID) { | |
319 GR_GL_CALL(fGpu->glInterface(), DeleteFramebuffers(1, &fID)); | |
320 } | |
321 } | |
322 GrGLuint fID; | |
323 GrGLGpu* fGpu; | |
324 | |
325 void reset() { | |
326 fID = 0; | |
327 } | |
328 }; | |
329 TempFBO fTempSrcFBO; | |
330 TempFBO fTempDstFBO; | |
331 | |
306 // last scissor / viewport scissor state seen by the GL. | 332 // last scissor / viewport scissor state seen by the GL. |
307 struct { | 333 struct { |
308 TriState fEnabled; | 334 TriState fEnabled; |
309 GrGLIRect fRect; | 335 GrGLIRect fRect; |
310 void invalidate() { | 336 void invalidate() { |
311 fEnabled = kUnknown_TriState; | 337 fEnabled = kUnknown_TriState; |
312 fRect.invalidate(); | 338 fRect.invalidate(); |
313 } | 339 } |
314 } fHWScissorSettings; | 340 } fHWScissorSettings; |
315 | 341 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 | 480 |
455 // we record what stencil format worked last time to hopefully exit early | 481 // we record what stencil format worked last time to hopefully exit early |
456 // from our loop that tries stencil formats and calls check fb status. | 482 // from our loop that tries stencil formats and calls check fb status. |
457 int fLastSuccessfulStencilFmtIdx; | 483 int fLastSuccessfulStencilFmtIdx; |
458 | 484 |
459 typedef GrGpu INHERITED; | 485 typedef GrGpu INHERITED; |
460 friend class GrGLPathRendering; // For accessing setTextureUnit. | 486 friend class GrGLPathRendering; // For accessing setTextureUnit. |
461 }; | 487 }; |
462 | 488 |
463 #endif | 489 #endif |
OLD | NEW |