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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void finishDrawTarget() override; | 119 void finishDrawTarget() override; |
120 | 120 |
121 private: | 121 private: |
122 GrGLGpu(GrGLContext* ctx, GrContext* context); | 122 GrGLGpu(GrGLContext* ctx, GrContext* context); |
123 | 123 |
124 // GrGpu overrides | 124 // GrGpu overrides |
125 void onResetContext(uint32_t resetBits) override; | 125 void onResetContext(uint32_t resetBits) override; |
126 | 126 |
127 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 127 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
128 | 128 |
129 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 129 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |
130 const SkTArray<GrMipLevel>& texels) override; | 130 const SkTArray<GrMipLevel>& texels) override; |
131 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 131 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
132 GrGpuResource::LifeCycle lifeCycle, | 132 SkBudgeted budgeted, |
133 const SkTArray<GrMipLevel>& texels) ove
rride; | 133 const SkTArray<GrMipLevel>& texels) ove
rride; |
134 | 134 |
135 GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrAccessPat
tern) override; | 135 GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrAccessPat
tern) override; |
136 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; | 136 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; |
137 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 137 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
138 GrWrapOwnership) override; | 138 GrWrapOwnership) override; |
139 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&) override; | 139 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&) override; |
140 // Given a GrPixelConfig return the index into the stencil format array on G
rGLCaps to a | 140 // Given a GrPixelConfig return the index into the stencil format array on G
rGLCaps to a |
141 // compatible stencil format, or negative if there is no compatible stencil
format. | 141 // compatible stencil format, or negative if there is no compatible stencil
format. |
142 int getCompatibleStencilIndex(GrPixelConfig config); | 142 int getCompatibleStencilIndex(GrPixelConfig config); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 // whenever a new texture needs to be created. Otherwise, we assume that | 342 // whenever a new texture needs to be created. Otherwise, we assume that |
343 // the texture is already in GPU memory and that it's going to be updated | 343 // the texture is already in GPU memory and that it's going to be updated |
344 // with new data. | 344 // with new data. |
345 bool uploadCompressedTexData(const GrSurfaceDesc& desc, | 345 bool uploadCompressedTexData(const GrSurfaceDesc& desc, |
346 GrGLenum target, | 346 GrGLenum target, |
347 const SkTArray<GrMipLevel>& texels, | 347 const SkTArray<GrMipLevel>& texels, |
348 UploadType uploadType = kNewTexture_UploadType, | 348 UploadType uploadType = kNewTexture_UploadType, |
349 int left = 0, int top = 0, | 349 int left = 0, int top = 0, |
350 int width = -1, int height = -1); | 350 int width = -1, int height = -1); |
351 | 351 |
352 bool createRenderTargetObjects(const GrSurfaceDesc&, GrGpuResource::LifeCycl
e lifeCycle, | 352 bool createRenderTargetObjects(const GrSurfaceDesc&, const GrGLTextureInfo&
texInfo, |
353 const GrGLTextureInfo& texInfo, GrGLRenderTar
get::IDDesc*); | 353 GrGLRenderTarget::IDDesc*); |
354 | 354 |
355 enum TempFBOTarget { | 355 enum TempFBOTarget { |
356 kSrc_TempFBOTarget, | 356 kSrc_TempFBOTarget, |
357 kDst_TempFBOTarget | 357 kDst_TempFBOTarget |
358 }; | 358 }; |
359 | 359 |
360 // Binds a surface as a FBO for a copy operation. If the surface already own
s an FBO ID then | 360 // Binds a surface as a FBO for a copy operation. If the surface already own
s an FBO ID then |
361 // that ID is bound. If not the surface is temporarily bound to a FBO and th
at FBO is bound. | 361 // that ID is bound. If not the surface is temporarily bound to a FBO and th
at FBO is bound. |
362 // This must be paired with a call to unbindSurfaceFBOForCopy(). | 362 // This must be paired with a call to unbindSurfaceFBOForCopy(). |
363 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, | 363 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 bool fHWPLSEnabled; | 566 bool fHWPLSEnabled; |
567 bool fPLSHasBeenUsed; | 567 bool fPLSHasBeenUsed; |
568 | 568 |
569 float fHWMinSampleShading; | 569 float fHWMinSampleShading; |
570 | 570 |
571 typedef GrGpu INHERITED; | 571 typedef GrGpu INHERITED; |
572 friend class GrGLPathRendering; // For accessing setTextureUnit. | 572 friend class GrGLPathRendering; // For accessing setTextureUnit. |
573 }; | 573 }; |
574 | 574 |
575 #endif | 575 #endif |
OLD | NEW |