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

Unified Diff: src/gpu/GrGpu.h

Issue 1854283004: Track GL buffer state based on unique resource ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index b3251dc14fa6bc2ca03a37f89d7cdda6ff16b56b..c56f60b75a149bc6e24fb9ced64f6d7071f35013 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -61,6 +61,12 @@ public:
GrPathRendering* pathRendering() { return fPathRendering.get(); }
+ /**
+ * Called by GrContext once the resource cache has been initialized. Any GrGpuResource objects
+ * owned by the sublcass need to be initialized here instead of in the constructor.
+ */
+ virtual void initGpuResources();
+
enum class DisconnectType {
// No cleanup should be attempted, immediately cease making backend API calls
kAbandon,
@@ -135,9 +141,13 @@ public:
/**
* Creates a buffer.
*
+ * @param size size of buffer to create.
+ * @param intendedType hint to the graphics subsystem about what the buffer will be used for.
+ * @param accessPattern hint to the graphics subsystem about how the data will be accessed.
+ *
* @return the buffer if successful, otherwise nullptr.
*/
- GrBuffer* createBuffer(GrBufferType, size_t size, GrAccessPattern);
+ GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPattern accessPattern);
/**
* Resolves MSAA.
@@ -533,7 +543,7 @@ private:
virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
GrWrapOwnership) = 0;
virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDesc&) = 0;
- virtual GrBuffer* onCreateBuffer(GrBufferType, size_t size, GrAccessPattern) = 0;
+ virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrAccessPattern) = 0;
// overridden by backend-specific derived class to perform the clear.
virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) = 0;
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698