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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 void buildProgramDesc(GrProgramDesc*, | 108 void buildProgramDesc(GrProgramDesc*, |
109 const GrPrimitiveProcessor&, | 109 const GrPrimitiveProcessor&, |
110 const GrPipeline&, | 110 const GrPipeline&, |
111 const GrBatchTracker&) const override; | 111 const GrBatchTracker&) const override; |
112 | 112 |
113 private: | 113 private: |
114 // GrGpu overrides | 114 // GrGpu overrides |
115 void onResetContext(uint32_t resetBits) override; | 115 void onResetContext(uint32_t resetBits) override; |
116 | 116 |
117 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, bool budgeted, const v
oid* srcData, | 117 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, |
118 size_t rowBytes) override; | 118 const void* srcData, size_t rowBytes) override; |
119 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, bool budgete
d, | 119 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
| 120 GrGpuResource::LifeCycle lifeCycle, |
120 const void* srcData) override; | 121 const void* srcData) override; |
121 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; | 122 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; |
122 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; | 123 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; |
123 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) override; | 124 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) override; |
124 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&)
override; | 125 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&)
override; |
125 bool createStencilAttachmentForRenderTarget(GrRenderTarget* rt, int width, i
nt height) override; | 126 bool createStencilAttachmentForRenderTarget(GrRenderTarget* rt, int width, i
nt height) override; |
126 bool attachStencilAttachmentToRenderTarget(GrStencilAttachment* sb, | 127 bool attachStencilAttachmentToRenderTarget(GrStencilAttachment* sb, |
127 GrRenderTarget* rt) override; | 128 GrRenderTarget* rt) override; |
128 | 129 |
129 void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color, | 130 void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // for the size of the data. The isNewTexture flag should be set to true | 271 // for the size of the data. The isNewTexture flag should be set to true |
271 // whenever a new texture needs to be created. Otherwise, we assume that | 272 // whenever a new texture needs to be created. Otherwise, we assume that |
272 // the texture is already in GPU memory and that it's going to be updated | 273 // the texture is already in GPU memory and that it's going to be updated |
273 // with new data. | 274 // with new data. |
274 bool uploadCompressedTexData(const GrSurfaceDesc& desc, | 275 bool uploadCompressedTexData(const GrSurfaceDesc& desc, |
275 const void* data, | 276 const void* data, |
276 bool isNewTexture = true, | 277 bool isNewTexture = true, |
277 int left = 0, int top = 0, | 278 int left = 0, int top = 0, |
278 int width = -1, int height = -1); | 279 int width = -1, int height = -1); |
279 | 280 |
280 bool createRenderTargetObjects(const GrSurfaceDesc&, bool budgeted, GrGLuint
texID, | 281 bool createRenderTargetObjects(const GrSurfaceDesc&, GrGpuResource::LifeCycl
e lifeCycle, |
281 GrGLRenderTarget::IDDesc*); | 282 GrGLuint texID, GrGLRenderTarget::IDDesc*); |
282 | 283 |
283 enum TempFBOTarget { | 284 enum TempFBOTarget { |
284 kSrc_TempFBOTarget, | 285 kSrc_TempFBOTarget, |
285 kDst_TempFBOTarget | 286 kDst_TempFBOTarget |
286 }; | 287 }; |
287 | 288 |
288 GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect*
viewport, | 289 GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect*
viewport, |
289 TempFBOTarget tempFBOTarget); | 290 TempFBOTarget tempFBOTarget); |
290 | 291 |
291 void unbindTextureFromFBO(GrGLenum fboTarget); | 292 void unbindTextureFromFBO(GrGLenum fboTarget); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 465 |
465 // we record what stencil format worked last time to hopefully exit early | 466 // we record what stencil format worked last time to hopefully exit early |
466 // from our loop that tries stencil formats and calls check fb status. | 467 // from our loop that tries stencil formats and calls check fb status. |
467 int fLastSuccessfulStencilFmtIdx; | 468 int fLastSuccessfulStencilFmtIdx; |
468 | 469 |
469 typedef GrGpu INHERITED; | 470 typedef GrGpu INHERITED; |
470 friend class GrGLPathRendering; // For accessing setTextureUnit. | 471 friend class GrGLPathRendering; // For accessing setTextureUnit. |
471 }; | 472 }; |
472 | 473 |
473 #endif | 474 #endif |
OLD | NEW |