diff options
author | Brian Salomon <bsalomon@google.com> | 2017-10-30 09:37:55 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-30 15:30:09 +0000 |
commit | 943ed7910f938d7b4894b4e925566cf7b7053f29 (patch) | |
tree | b281c6fb91ede12be586ee7d475a2c4f38e15f5d /src/gpu/GrDrawOpAtlas.cpp | |
parent | f18b1d88aa98f81d2c115a59d887265fea63f876 (diff) |
Remove deferred upload types from GrDrawOp.h.
This is motivated by exposing these to an upcoming atlas text rendering API that doesn't use ops.
Change-Id: Id034dd43d13bc96fe1350fc6d8f699477bb74a05
Reviewed-on: https://skia-review.googlesource.com/65060
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrDrawOpAtlas.cpp')
-rw-r--r-- | src/gpu/GrDrawOpAtlas.cpp | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp index 20d2c06a60..1a1452caac 100644 --- a/src/gpu/GrDrawOpAtlas.cpp +++ b/src/gpu/GrDrawOpAtlas.cpp @@ -37,8 +37,8 @@ static bool gDumpAtlasData = false; GrDrawOpAtlas::Plot::Plot(int pageIndex, int plotIndex, uint64_t genID, int offX, int offY, int width, int height, GrPixelConfig config) - : fLastUpload(GrDrawOpUploadToken::AlreadyFlushedToken()) - , fLastUse(GrDrawOpUploadToken::AlreadyFlushedToken()) + : fLastUpload(GrDeferredUploadToken::AlreadyFlushedToken()) + , fLastUse(GrDeferredUploadToken::AlreadyFlushedToken()) , fFlushesSinceLastUse(0) , fPageIndex(pageIndex) , fPlotIndex(plotIndex) @@ -110,7 +110,7 @@ bool GrDrawOpAtlas::Plot::addSubImage(int width, int height, const void* image, return true; } -void GrDrawOpAtlas::Plot::uploadToTexture(GrDrawOp::WritePixelsFn& writePixels, +void GrDrawOpAtlas::Plot::uploadToTexture(GrDeferredTextureUploadWritePixelsFn& writePixels, GrTextureProxy* proxy) { // We should only be issuing uploads if we are in fact dirty SkASSERT(fDirty && fData && proxy && proxy->priv().peekTexture()); @@ -132,8 +132,8 @@ void GrDrawOpAtlas::Plot::resetRects() { fGenID++; fID = CreateId(fPageIndex, fPlotIndex, fGenID); - fLastUpload = GrDrawOpUploadToken::AlreadyFlushedToken(); - fLastUse = GrDrawOpUploadToken::AlreadyFlushedToken(); + fLastUpload = GrDeferredUploadToken::AlreadyFlushedToken(); + fLastUse = GrDeferredUploadToken::AlreadyFlushedToken(); // zero out the plot if (fData) { @@ -153,9 +153,8 @@ GrDrawOpAtlas::GrDrawOpAtlas(GrContext* context, GrPixelConfig config, int width , fTextureWidth(width) , fTextureHeight(height) , fAtlasGeneration(kInvalidAtlasGeneration + 1) - , fPrevFlushToken(GrDrawOpUploadToken::AlreadyFlushedToken()) + , fPrevFlushToken(GrDeferredUploadToken::AlreadyFlushedToken()) , fNumPages(0) { - fPlotWidth = fTextureWidth / numPlotsX; fPlotHeight = fTextureHeight / numPlotsY; SkASSERT(numPlotsX * numPlotsY <= BulkUseTokenUpdater::kMaxPlots); @@ -193,11 +192,10 @@ inline bool GrDrawOpAtlas::updatePlot(GrDrawOp::Target* target, AtlasID* id, Plo GrTextureProxy* proxy = fProxies[pageIdx].get(); - GrDrawOpUploadToken lastUploadToken = target->addAsapUpload( - [plotsp, proxy] (GrDrawOp::WritePixelsFn& writePixels) { - plotsp->uploadToTexture(writePixels, proxy); - } - ); + GrDeferredUploadToken lastUploadToken = target->addAsapUpload( + [plotsp, proxy](GrDeferredTextureUploadWritePixelsFn& writePixels) { + plotsp->uploadToTexture(writePixels, proxy); + }); plot->setLastUploadToken(lastUploadToken); } *id = plot->id(); @@ -314,11 +312,10 @@ bool GrDrawOpAtlas::addToAtlas(AtlasID* id, GrDrawOp::Target* target, int width, } GrTextureProxy* proxy = fProxies[pageIdx].get(); - GrDrawOpUploadToken lastUploadToken = target->addInlineUpload( - [plotsp, proxy] (GrDrawOp::WritePixelsFn& writePixels) { - plotsp->uploadToTexture(writePixels, proxy); - } - ); + GrDeferredUploadToken lastUploadToken = target->addInlineUpload( + [plotsp, proxy](GrDeferredTextureUploadWritePixelsFn& writePixels) { + plotsp->uploadToTexture(writePixels, proxy); + }); newPlot->setLastUploadToken(lastUploadToken); *id = newPlot->id(); @@ -326,7 +323,7 @@ bool GrDrawOpAtlas::addToAtlas(AtlasID* id, GrDrawOp::Target* target, int width, return true; } -void GrDrawOpAtlas::compact(GrDrawOpUploadToken startTokenForNextFlush) { +void GrDrawOpAtlas::compact(GrDeferredUploadToken startTokenForNextFlush) { if (fNumPages <= 1) { fPrevFlushToken = startTokenForNextFlush; return; @@ -425,7 +422,7 @@ void GrDrawOpAtlas::compact(GrDrawOpUploadToken startTokenForNextFlush) { this->processEvictionAndResetRects(plot); --availablePlots; } - } else if (plot->lastUseToken() != GrDrawOpUploadToken::AlreadyFlushedToken()) { + } else if (plot->lastUseToken() != GrDeferredUploadToken::AlreadyFlushedToken()) { // otherwise if aged out just evict it. this->processEvictionAndResetRects(plot); } |