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

Side by Side Diff: src/gpu/GrGpu.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: rebase 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
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 GrGpu_DEFINED 8 #ifndef GrGpu_DEFINED
9 #define GrGpu_DEFINED 9 #define GrGpu_DEFINED
10 10
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 // assumed 3D context state and dirty any state cache. 520 // assumed 3D context state and dirty any state cache.
521 virtual void onResetContext(uint32_t resetBits) = 0; 521 virtual void onResetContext(uint32_t resetBits) = 0;
522 522
523 // Called before certain draws in order to guarantee coherent results from d st reads. 523 // Called before certain draws in order to guarantee coherent results from d st reads.
524 virtual void xferBarrier(GrRenderTarget*, GrXferBarrierType) = 0; 524 virtual void xferBarrier(GrRenderTarget*, GrXferBarrierType) = 0;
525 525
526 // overridden by backend-specific derived class to create objects. 526 // overridden by backend-specific derived class to create objects.
527 // Texture size and sample size will have already been validated in base cla ss before 527 // Texture size and sample size will have already been validated in base cla ss before
528 // onCreateTexture/CompressedTexture are called. 528 // onCreateTexture/CompressedTexture are called.
529 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, 529 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc,
530 GrGpuResource::LifeCycle lifeCycle, 530 SkBudgeted budgeted,
531 const SkTArray<GrMipLevel>& texels) = 0; 531 const SkTArray<GrMipLevel>& texels) = 0;
532 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, 532 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc,
533 GrGpuResource::LifeCycle lifeCy cle, 533 SkBudgeted budgeted,
534 const SkTArray<GrMipLevel>& tex els) = 0; 534 const SkTArray<GrMipLevel>& tex els) = 0;
535 535
536 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO wnership) = 0; 536 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO wnership) = 0;
537 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge tDesc&, 537 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge tDesc&,
538 GrWrapOwnership) = 0; 538 GrWrapOwnership) = 0;
539 virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTe xtureDesc&) = 0; 539 virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTe xtureDesc&) = 0;
540 virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrA ccessPattern) = 0; 540 virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrA ccessPattern) = 0;
541 541
542 // overridden by backend-specific derived class to perform the clear. 542 // overridden by backend-specific derived class to perform the clear.
543 virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) = 0; 543 virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) = 0;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 SkTArray<const MultisampleSpecs*, true> fMultisa mpleSpecsMap; 608 SkTArray<const MultisampleSpecs*, true> fMultisa mpleSpecsMap;
609 GrTAllocator<MultisampleSpecs> fMultisa mpleSpecsAllocator; 609 GrTAllocator<MultisampleSpecs> fMultisa mpleSpecsAllocator;
610 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. 610 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu.
611 GrContext* fContext ; 611 GrContext* fContext ;
612 612
613 friend class GrPathRendering; 613 friend class GrPathRendering;
614 typedef SkRefCnt INHERITED; 614 typedef SkRefCnt INHERITED;
615 }; 615 };
616 616
617 #endif 617 #endif
OLDNEW
« include/gpu/GrTypes.h ('K') | « include/gpu/GrTypes.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698