diff options
Diffstat (limited to 'src/gpu/GrOpFlushState.cpp')
-rw-r--r-- | src/gpu/GrOpFlushState.cpp | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/gpu/GrOpFlushState.cpp b/src/gpu/GrOpFlushState.cpp index 72deabe197..c6f5d38383 100644 --- a/src/gpu/GrOpFlushState.cpp +++ b/src/gpu/GrOpFlushState.cpp @@ -8,7 +8,7 @@ #include "GrOpFlushState.h" #include "GrDrawOpAtlas.h" -#include "GrResourceProvider.h" +#include "GrPipeline.h" GrOpFlushState::GrOpFlushState(GrGpu* gpu, GrResourceProvider* resourceProvider) : fGpu(gpu) @@ -29,33 +29,3 @@ uint16_t* GrOpFlushState::makeIndexSpace(int indexCount, const GrBuffer** buffer, int* startIndex) { return reinterpret_cast<uint16_t*>(fIndexPool.makeSpace(indexCount, buffer, startIndex)); } - -void GrOpFlushState::doUpload(GrDrawOp::DeferredUploadFn& upload) { - GrDrawOp::WritePixelsFn wp = [this](GrSurface* surface, int left, int top, int width, - int height, GrPixelConfig config, const void* buffer, - size_t rowBytes) { - GrGpu::DrawPreference drawPreference = GrGpu::kNoDraw_DrawPreference; - GrGpu::WritePixelTempDrawInfo tempInfo; - fGpu->getWritePixelsInfo(surface, width, height, surface->config(), &drawPreference, - &tempInfo); - if (GrGpu::kNoDraw_DrawPreference == drawPreference) { - return this->fGpu->writePixels(surface, left, top, width, height, config, buffer, - rowBytes); - } - GrSurfaceDesc desc; - desc.fConfig = surface->config(); - desc.fWidth = width; - desc.fHeight = height; - desc.fOrigin = surface->origin(); - sk_sp<GrTexture> temp(this->fResourceProvider->createApproxTexture( - desc, GrResourceProvider::kNoPendingIO_Flag)); - if (!temp) { - return false; - } - if (!fGpu->writePixels(temp.get(), 0, 0, width, height, desc.fConfig, buffer, rowBytes)) { - return false; - } - return fGpu->copySurface(surface, temp.get(), SkIRect::MakeWH(width, height), {left, top}); - }; - upload(wp); -} |