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

Unified Diff: src/gpu/GrGpu.h

Issue 2078483002: Start using GrGpuCommandBuffer in GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@memoryWAR
Patch Set: review nits Created 4 years, 6 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 a99ce8f45e4370c042640dbca967ea4ca042004a..df82b20ba25191f5bb8eade38f832965ca3757fa 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -300,20 +300,6 @@ public:
size_t offset, size_t rowBytes);
/**
- * Clear the passed in render target. Ignores the draw state and clip.
- */
- void clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget);
-
-
- void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* renderTarget);
-
- /**
- * Discards the contents render target. nullptr indicates that the current render target should
- * be discarded.
- **/
- virtual void discard(GrRenderTarget* = nullptr) = 0;
-
- /**
* This is can be called before allocating a texture to be a dst for copySurface. It will
* populate the origin, config, and flags fields of the desc such that copySurface can
* efficiently succeed. It should only succeed if it can allow copySurface to perform a copy
@@ -363,21 +349,12 @@ public:
// Creates a GrGpuCommandBuffer in which the GrDrawTarget can send draw commands to instead of
// directly to the Gpu object.
- virtual GrGpuCommandBuffer* createCommandBuffer(const GrRenderTarget& target,
+ virtual GrGpuCommandBuffer* createCommandBuffer(GrRenderTarget* target,
GrGpuCommandBuffer::LoadAndStoreOp colorOp,
GrColor colorClear,
GrGpuCommandBuffer::LoadAndStoreOp stencilOp,
GrColor stencilClear) = 0;
- // We pass in an array of meshCount GrMesh to the draw. The backend should loop over each
- // GrMesh object and emit a draw for it. Each draw will use the same GrPipeline and
- // GrPrimitiveProcessor. This may fail if the draw would exceed any resource limits (e.g.
- // number of vertex attributes is too large).
- bool draw(const GrPipeline&,
- const GrPrimitiveProcessor&,
- const GrMesh*,
- int meshCount);
-
// Called by drawtarget when flushing.
// Provides a hook for post-flush actions (e.g. PLS reset and Vulkan command buffer submits).
virtual void finishDrawTarget() {}
@@ -543,19 +520,6 @@ private:
virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrAccessPattern,
const void* data) = 0;
- // overridden by backend-specific derived class to perform the clear.
- virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) = 0;
-
- // Overridden by backend specific classes to perform a clear of the stencil clip bits. This is
- // ONLY used by the the clip target
- virtual void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideClip) = 0;
-
- // overridden by backend-specific derived class to perform the draw call.
- virtual void onDraw(const GrPipeline&,
- const GrPrimitiveProcessor&,
- const GrMesh*,
- int meshCount) = 0;
-
virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrTextureParams&,
GrTextureProducer::CopyParams*) const { return false; }
@@ -614,6 +578,7 @@ private:
// The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu.
GrContext* fContext;
+ friend class GrGpuCommandBuffer;
bsalomon 2016/06/20 16:51:14 why does this need to be a friend?
egdaniel 2016/06/22 15:26:57 it is for the handleDirtyContext call on GrGpuComm
bsalomon 2016/06/22 15:41:15 I'd just make handleDirtyContext() public. Should
egdaniel 2016/06/22 21:13:35 Made public. Previously we decided not to move it
friend class GrPathRendering;
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | src/gpu/GrGpuCommandBuffer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698