blob: a05d37fed31b7bec963cff2d542d38802c35ede2 [file] [log] [blame]
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrSurfaceContext_DEFINED
#define GrSurfaceContext_DEFINED
#include "SkRefCnt.h"
class GrAuditTrail;
class GrContext;
class GrSingleOwner;
class GrSurface;
struct SkIPoint;
struct SkIRect;
/**
* A helper object to orchestrate commands for a particular surface
*/
class SK_API GrSurfaceContext : public SkRefCnt {
public:
~GrSurfaceContext() override {}
virtual bool copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint) = 0;
GrAuditTrail* auditTrail() { return fAuditTrail; }
protected:
GrSurfaceContext(GrContext*, GrAuditTrail*, GrSingleOwner*);
SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; })
GrContext* fContext;
GrAuditTrail* fAuditTrail;
// In debug builds we guard against improper thread handling
SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;)
};
#endif