Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: src/gpu/gl/GrGLGpu.h

Issue 1862043002: Refactor to separate backend object lifecycle and GpuResource budget decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix unrelated GrBuffer::onGpuMemorySize() lack of override keyword compile error Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLBuffer.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, 135 GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrAccessPat tern,
136 const void* data) override; 136 const void* data) override;
137 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override; 137 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override;
138 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, 138 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
139 GrWrapOwnership) override; 139 GrWrapOwnership) override;
140 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes c&) override; 140 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes c&) override;
141 // Given a GrPixelConfig return the index into the stencil format array on G rGLCaps to a 141 // Given a GrPixelConfig return the index into the stencil format array on G rGLCaps to a
142 // compatible stencil format, or negative if there is no compatible stencil format. 142 // compatible stencil format, or negative if there is no compatible stencil format.
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 // whenever a new texture needs to be created. Otherwise, we assume that 340 // whenever a new texture needs to be created. Otherwise, we assume that
341 // the texture is already in GPU memory and that it's going to be updated 341 // the texture is already in GPU memory and that it's going to be updated
342 // with new data. 342 // with new data.
343 bool uploadCompressedTexData(const GrSurfaceDesc& desc, 343 bool uploadCompressedTexData(const GrSurfaceDesc& desc,
344 GrGLenum target, 344 GrGLenum target,
345 const SkTArray<GrMipLevel>& texels, 345 const SkTArray<GrMipLevel>& texels,
346 UploadType uploadType = kNewTexture_UploadType, 346 UploadType uploadType = kNewTexture_UploadType,
347 int left = 0, int top = 0, 347 int left = 0, int top = 0,
348 int width = -1, int height = -1); 348 int width = -1, int height = -1);
349 349
350 bool createRenderTargetObjects(const GrSurfaceDesc&, GrGpuResource::LifeCycl e lifeCycle, 350 bool createRenderTargetObjects(const GrSurfaceDesc&, const GrGLTextureInfo& texInfo,
351 const GrGLTextureInfo& texInfo, GrGLRenderTar get::IDDesc*); 351 GrGLRenderTarget::IDDesc*);
352 352
353 enum TempFBOTarget { 353 enum TempFBOTarget {
354 kSrc_TempFBOTarget, 354 kSrc_TempFBOTarget,
355 kDst_TempFBOTarget 355 kDst_TempFBOTarget
356 }; 356 };
357 357
358 // Binds a surface as a FBO for a copy operation. If the surface already own s an FBO ID then 358 // Binds a surface as a FBO for a copy operation. If the surface already own s an FBO ID then
359 // that ID is bound. If not the surface is temporarily bound to a FBO and th at FBO is bound. 359 // that ID is bound. If not the surface is temporarily bound to a FBO and th at FBO is bound.
360 // This must be paired with a call to unbindSurfaceFBOForCopy(). 360 // This must be paired with a call to unbindSurfaceFBOForCopy().
361 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect * viewport, 361 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect * viewport,
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 bool fHWPLSEnabled; 564 bool fHWPLSEnabled;
565 bool fPLSHasBeenUsed; 565 bool fPLSHasBeenUsed;
566 566
567 float fHWMinSampleShading; 567 float fHWMinSampleShading;
568 568
569 typedef GrGpu INHERITED; 569 typedef GrGpu INHERITED;
570 friend class GrGLPathRendering; // For accessing setTextureUnit. 570 friend class GrGLPathRendering; // For accessing setTextureUnit.
571 }; 571 };
572 572
573 #endif 573 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLBuffer.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698