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

Unified Diff: src/gpu/GrInOrderDrawBuffer.h

Issue 13581003: Make GrIODB record and play back copySurface. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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/GrInOrderDrawBuffer.h
===================================================================
--- src/gpu/GrInOrderDrawBuffer.h (revision 8526)
+++ src/gpu/GrInOrderDrawBuffer.h (working copy)
@@ -33,7 +33,7 @@
* responsibility to ensure that all referenced textures, buffers, and render-targets are associated
* in the GrGpu object that the buffer is played back into. The buffer requires VB and IB pools to
* store geometry.
- */
+ */
class GrInOrderDrawBuffer : public GrDrawTarget {
public:
@@ -87,6 +87,7 @@
kSetState_Cmd = 3,
kSetClip_Cmd = 4,
kClear_Cmd = 5,
+ kCopySurface_Cmd = 6,
};
class DrawRecord : public DrawInfo {
@@ -96,7 +97,7 @@
const GrIndexBuffer* fIndexBuffer;
};
- struct StencilPath {
+ struct StencilPath : GrNoncopyable {
StencilPath();
SkAutoTUnref<const GrPath> fPath;
@@ -104,7 +105,7 @@
SkPath::FillType fFill;
};
- struct Clear {
+ struct Clear : GrNoncopyable {
Clear() : fRenderTarget(NULL) {}
~Clear() { GrSafeUnref(fRenderTarget); }
@@ -113,6 +114,13 @@
GrRenderTarget* fRenderTarget;
};
+ struct CopySurface : GrNoncopyable {
+ SkAutoTUnref<GrSurface> fDst;
+ SkAutoTUnref<GrSurface> fSrc;
+ SkIRect fSrcRect;
+ SkIPoint fDstPoint;
+ };
+
// overrides from GrDrawTarget
virtual void onDraw(const DrawInfo&) SK_OVERRIDE;
virtual void onDrawRect(const GrRect& rect,
@@ -137,6 +145,15 @@
virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) SK_OVERRIDE;
virtual void willReserveVertexAndIndexSpace(int vertexCount,
int indexCount) SK_OVERRIDE;
+ virtual bool onCopySurface(GrSurface* dst,
+ GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint) SK_OVERRIDE;
+ virtual bool onCanCopySurface(GrSurface* dst,
+ GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint) SK_OVERRIDE;
+
bool quickInsideClip(const SkRect& devBounds);
// Attempts to concat instances from info onto the previous draw. info must represent an
@@ -154,7 +171,9 @@
DrawRecord* recordDraw(const DrawInfo&);
StencilPath* recordStencilPath();
Clear* recordClear();
+ CopySurface* recordCopySurface();
+ // TODO: Use a single allocator for commands and records
enum {
kCmdPreallocCnt = 32,
kDrawPreallocCnt = 8,
@@ -163,6 +182,7 @@
kClipPreallocCnt = 8,
kClearPreallocCnt = 4,
kGeoPoolStatePreAllocCnt = 4,
+ kCopySurfacePreallocCnt = 4,
};
SkSTArray<kCmdPreallocCnt, uint8_t, true> fCmds;
@@ -170,10 +190,10 @@
GrSTAllocator<kStatePreallocCnt, StencilPath> fStencilPaths;
GrSTAllocator<kStatePreallocCnt, GrDrawState::DeferredState> fStates;
GrSTAllocator<kClearPreallocCnt, Clear> fClears;
+ GrSTAllocator<kCopySurfacePreallocCnt, CopySurface> fCopySurfaces;
+ GrSTAllocator<kClipPreallocCnt, SkClipStack> fClips;
+ GrSTAllocator<kClipPreallocCnt, SkIPoint> fClipOrigins;
- GrSTAllocator<kClipPreallocCnt, SkClipStack> fClips;
- GrSTAllocator<kClipPreallocCnt, SkIPoint> fClipOrigins;
-
GrDrawTarget* fDstGpu;
bool fClipSet;

Powered by Google App Engine
This is Rietveld 408576698