aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkGpu.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-18 10:02:08 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-18 16:20:55 +0000
commitd1eaf49e0b8b2776b1558ffd3ee1d3d9f9592b6b (patch)
treef59e23ba0ded7b764d7cee753ea9c16d6a3bdb2f /src/gpu/vk/GrVkGpu.cpp
parent9d2d7bfc920772b5e8ec31eae8e3ec88704e943f (diff)
Revert "Revert "Remove GrSurface::desc() method.""
This reverts commit c96da1e51e1ca72d54dda49f32891bd41530ad31. Bug: skia: Change-Id: I8242400a137413c01c7ef614b4fa733be7dcf939 Reviewed-on: https://skia-review.googlesource.com/17311 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkGpu.cpp')
-rw-r--r--src/gpu/vk/GrVkGpu.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 8469755492..c438acc58e 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -503,9 +503,7 @@ bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex,
size_t bpp = GrBytesPerPixel(dataConfig);
- const GrSurfaceDesc& desc = tex->desc();
-
- if (!GrSurfacePriv::AdjustWritePixelParams(desc.fWidth, desc.fHeight, bpp, &left, &top,
+ if (!GrSurfacePriv::AdjustWritePixelParams(tex->width(), tex->height(), bpp, &left, &top,
&width, &height, &data, &rowBytes)) {
return false;
}
@@ -528,7 +526,7 @@ bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex,
&subres,
&layout));
- int texTop = kBottomLeft_GrSurfaceOrigin == desc.fOrigin ? tex->height() - top - height : top;
+ int texTop = kBottomLeft_GrSurfaceOrigin == tex->origin() ? tex->height() - top - height : top;
const GrVkAlloc& alloc = tex->alloc();
VkDeviceSize offset = alloc.fOffset + texTop*layout.rowPitch + left*bpp;
VkDeviceSize size = height*layout.rowPitch;
@@ -538,7 +536,7 @@ bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex,
return false;
}
- if (kBottomLeft_GrSurfaceOrigin == desc.fOrigin) {
+ if (kBottomLeft_GrSurfaceOrigin == tex->origin()) {
// copy into buffer by rows
const char* srcRow = reinterpret_cast<const char*>(data);
char* dstRow = reinterpret_cast<char*>(mapPtr)+(height - 1)*layout.rowPitch;
@@ -578,8 +576,7 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex,
return false;
}
- const GrSurfaceDesc& desc = tex->desc();
- SkASSERT(this->caps()->isConfigTexturable(desc.fConfig));
+ SkASSERT(this->caps()->isConfigTexturable(tex->config()));
size_t bpp = GrBytesPerPixel(dataConfig);
// texels is const.
@@ -593,17 +590,15 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex,
}
// Determine whether we need to flip when we copy into the buffer
- bool flipY = (kBottomLeft_GrSurfaceOrigin == desc.fOrigin && !texelsShallowCopy.empty());
+ bool flipY = (kBottomLeft_GrSurfaceOrigin == tex->origin() && !texelsShallowCopy.empty());
// adjust any params (left, top, currentWidth, currentHeight
// find the combined size of all the mip levels and the relative offset of
// each into the collective buffer
// Do the first level separately because we may need to adjust width and height
// (for the non-mipped case).
- if (!GrSurfacePriv::AdjustWritePixelParams(desc.fWidth, desc.fHeight, bpp, &left, &top,
- &width,
- &height,
- &texelsShallowCopy[0].fPixels,
+ if (!GrSurfacePriv::AdjustWritePixelParams(tex->width(), tex->height(), bpp, &left, &top,
+ &width, &height, &texelsShallowCopy[0].fPixels,
&texelsShallowCopy[0].fRowBytes)) {
return false;
}
@@ -619,9 +614,8 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex,
for (int currentMipLevel = 1; currentMipLevel < texelsShallowCopy.count(); currentMipLevel++) {
currentWidth = SkTMax(1, currentWidth/2);
currentHeight = SkTMax(1, currentHeight/2);
- if (!GrSurfacePriv::AdjustWritePixelParams(desc.fWidth, desc.fHeight, bpp, &left, &top,
- &currentWidth,
- &currentHeight,
+ if (!GrSurfacePriv::AdjustWritePixelParams(tex->width(), tex->height(), bpp, &left, &top,
+ &currentWidth, &currentHeight,
&texelsShallowCopy[currentMipLevel].fPixels,
&texelsShallowCopy[currentMipLevel].fRowBytes)) {
return false;