// Check to see if this set of draw commands has been sent out
virtual bool isIssued(uint32_t drawID) { return true; }
- virtual GrClipMaskManager* clipMaskManager() = 0;
+ virtual GrClipMaskManager* getClipMaskManager() = 0;
enum {
kPreallocGeoSrcStateStackCnt = 4,
GrClipMaskManager fClipMaskManager;
private:
- GrClipMaskManager* clipMaskManager() { return &fClipMaskManager; }
+ GrClipMaskManager* getClipMaskManager() { return &fClipMaskManager; }
typedef GrDrawTarget INHERITED;
};
GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
+ bool inheritedCouldCopy = INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint);
bool copied = false;
- if (can_copy_texsubimage(dst, src, this)) {
+ bool wouldNeedTempFBO = false;
+ if (can_copy_texsubimage(dst, src, this, &wouldNeedTempFBO) &&
+ (!wouldNeedTempFBO || !inheritedCouldCopy)) {
GrGLuint srcFBO;
GrGLIRect srcVP;
srcFBO = this->bindSurfaceAsFBO(src, GR_GL_FRAMEBUFFER, &srcVP);
if (srcFBO) {
GL_CALL(DeleteFramebuffers(1, &srcFBO));
}
- } else if (can_blit_framebuffer(dst, src, this)) {
+ } else if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) &&
+ (!wouldNeedTempFBO || !inheritedCouldCopy)) {
SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX, dstPoint.fY,
srcRect.width(), srcRect.height());
bool selfOverlap = false;
copied = true;
}
}
+ if (!copied && inheritedCouldCopy) {
+ copied = INHERITED::onCopySurface(dst, src, srcRect, dstPoint);
+ SkASSERT(copied);
+ }
return copied;
}
GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
- // This mirrors the logic in onCopySurface. We prefer our base makes the copy if we need to
- // create a temp fbo
- // TODO verify this assumption, it may not be true at all
- bool wouldNeedTempFBO = false;
- if (can_copy_texsubimage(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTempFBO) {
+ // This mirrors the logic in onCopySurface.
+ if (can_copy_texsubimage(dst, src, this)) {
return true;
}
- if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTempFBO) {
+ if (can_blit_framebuffer(dst, src, this)) {
if (dst->surfacePriv().isSameAs(src)) {
SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX, dstPoint.fY,
srcRect.width(), srcRect.height());
return true;
}
}
- return false;
+ return INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint);
}
void GrGpuGL::didAddGpuTraceMarker() {