diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 6 | ||||
-rw-r--r-- | src/core/SkMultiPictureDraw.cpp | 13 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index c7a9dc72f2..f8b0a0ab0b 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1143,6 +1143,8 @@ static void draw_filter_into_device(SkBaseDevice* src, const SkImageFilter* filt SkBitmap srcBM; #if SK_SUPPORT_GPU + // TODO: remove this virtual usage of accessRenderTarget! It is preventing + // removal of the virtual on SkBaseDevice. GrRenderTarget* srcRT = src->accessRenderTarget(); if (srcRT && !srcRT->asTexture() && dst->accessRenderTarget()) { // When both the src & the dst are on the gpu but the src doesn't have a texture, @@ -1858,9 +1860,9 @@ const SkRegion& SkCanvas::internal_private_getTotalClip() const { return fMCRec->fRasterClip.forceGetBW(); } -GrRenderTarget* SkCanvas::internal_private_accessTopLayerRenderTarget() { +GrDrawContext* SkCanvas::internal_private_accessTopLayerDrawContext() { SkBaseDevice* dev = this->getTopDevice(); - return dev ? dev->accessRenderTarget() : nullptr; + return dev ? dev->accessDrawContext() : nullptr; } GrContext* SkCanvas::getGrContext() { diff --git a/src/core/SkMultiPictureDraw.cpp b/src/core/SkMultiPictureDraw.cpp index 09efba9377..26e446d2ad 100644 --- a/src/core/SkMultiPictureDraw.cpp +++ b/src/core/SkMultiPictureDraw.cpp @@ -16,6 +16,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" +#include "GrDrawContext.h" #include "GrLayerHoister.h" #include "GrRecordReplaceDraw.h" #include "GrRenderTarget.h" @@ -132,8 +133,8 @@ void SkMultiPictureDraw::draw(bool flush) { SkMatrix initialMatrix = data.fCanvas->getTotalMatrix(); initialMatrix.preConcat(data.fMatrix); - GrRenderTarget* rt = data.fCanvas->internal_private_accessTopLayerRenderTarget(); - SkASSERT(rt); + GrDrawContext* dc = data.fCanvas->internal_private_accessTopLayerDrawContext(); + SkASSERT(dc); // TODO: sorting the cacheable layers from smallest to largest // would improve the packing and reduce the number of swaps @@ -142,7 +143,7 @@ void SkMultiPictureDraw::draw(bool flush) { GrLayerHoister::FindLayersToAtlas(context, data.fPicture, initialMatrix, clipBounds, &atlasedNeedRendering, &atlasedRecycled, - rt->numColorSamples()); + dc->numColorSamples()); } } @@ -168,14 +169,14 @@ void SkMultiPictureDraw::draw(bool flush) { const SkMatrix initialMatrix = canvas->getTotalMatrix(); - GrRenderTarget* rt = data.fCanvas->internal_private_accessTopLayerRenderTarget(); - SkASSERT(rt); + GrDrawContext* dc = data.fCanvas->internal_private_accessTopLayerDrawContext(); + SkASSERT(dc); // Find the layers required by this canvas. It will return atlased // layers in the 'recycled' list since they have already been drawn. GrLayerHoister::FindLayersToHoist(context, picture, initialMatrix, clipBounds, &needRendering, &recycled, - rt->numColorSamples()); + dc->numColorSamples()); GrLayerHoister::DrawLayers(context, needRendering); |