aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawOpAtlas.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-07-28 10:54:53 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-28 15:22:57 +0000
commitacaa607328fb0dfac0894d4a2fcdead520e696b3 (patch)
tree39ddb2a9f9bc56c861b2ba37edd20dadb2652159 /src/gpu/GrDrawOpAtlas.cpp
parent5d169ed337c009175783f77f56b5d96f0e3ece67 (diff)
Make op-level texture uploading be GrProxy-based
Change-Id: I898d626eff059fa7c687357b536d09409a174358 Reviewed-on: https://skia-review.googlesource.com/28001 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrDrawOpAtlas.cpp')
-rw-r--r--src/gpu/GrDrawOpAtlas.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 897622ac28..9b2afc774f 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -129,15 +129,15 @@ bool GrDrawOpAtlas::Plot::addSubImage(int width, int height, const void* image,
}
void GrDrawOpAtlas::Plot::uploadToTexture(GrDrawOp::WritePixelsFn& writePixels,
- GrTexture* texture) {
+ GrTextureProxy* proxy) {
// We should only be issuing uploads if we are in fact dirty
- SkASSERT(fDirty && fData && texture);
+ SkASSERT(fDirty && fData && proxy && proxy->priv().peekTexture());
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
size_t rowBytes = fBytesPerPixel * fWidth;
const unsigned char* dataPtr = fData;
dataPtr += rowBytes * fDirtyRect.fTop;
dataPtr += fBytesPerPixel * fDirtyRect.fLeft;
- writePixels(texture, fOffset.fX + fDirtyRect.fLeft, fOffset.fY + fDirtyRect.fTop,
+ writePixels(proxy, fOffset.fX + fDirtyRect.fLeft, fOffset.fY + fDirtyRect.fTop,
fDirtyRect.width(), fDirtyRect.height(), fConfig, dataPtr, rowBytes);
fDirtyRect.setEmpty();
SkDEBUGCODE(fDirty = false;)
@@ -213,11 +213,12 @@ inline bool GrDrawOpAtlas::updatePlot(GrDrawOp::Target* target, AtlasID* id, Plo
if (!fProxy->instantiate(fContext->resourceProvider())) {
return false;
}
- GrTexture* texture = fProxy->priv().peekTexture();
+
+ GrTextureProxy* proxy = fProxy.get();
GrDrawOpUploadToken lastUploadToken = target->addAsapUpload(
- [plotsp, texture] (GrDrawOp::WritePixelsFn& writePixels) {
- plotsp->uploadToTexture(writePixels, texture);
+ [plotsp, proxy] (GrDrawOp::WritePixelsFn& writePixels) {
+ plotsp->uploadToTexture(writePixels, proxy);
}
);
plot->setLastUploadToken(lastUploadToken);
@@ -292,11 +293,11 @@ bool GrDrawOpAtlas::addToAtlas(AtlasID* id, GrDrawOp::Target* target, int width,
if (!fProxy->instantiate(fContext->resourceProvider())) {
return false;
}
- GrTexture* texture = fProxy->priv().peekTexture();
+ GrTextureProxy* proxy = fProxy.get();
GrDrawOpUploadToken lastUploadToken = target->addInlineUpload(
- [plotsp, texture] (GrDrawOp::WritePixelsFn& writePixels) {
- plotsp->uploadToTexture(writePixels, texture);
+ [plotsp, proxy] (GrDrawOp::WritePixelsFn& writePixels) {
+ plotsp->uploadToTexture(writePixels, proxy);
}
);
newPlot->setLastUploadToken(lastUploadToken);