diff options
author | 2017-05-17 15:15:26 -0400 | |
---|---|---|
committer | 2017-05-17 19:50:10 +0000 | |
commit | 9ac995354428a916df81253e0c0c3f582db18976 (patch) | |
tree | 9f09323f6deda4e9e4371de9c7879aff178e7eda /src/gpu/vk | |
parent | 6e3ce40bd93e5de16b0086cb70320ff3283e72cf (diff) |
Remove GrSurface::desc() method.
Change-Id: If158dee90b3b0f80aa9c674180fbe6abd5b27d3f
Reviewed-on: https://skia-review.googlesource.com/17268
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/vk')
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 24 |
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, - ¤tWidth, - ¤tHeight, + if (!GrSurfacePriv::AdjustWritePixelParams(tex->width(), tex->height(), bpp, &left, &top, + ¤tWidth, ¤tHeight, &texelsShallowCopy[currentMipLevel].fPixels, &texelsShallowCopy[currentMipLevel].fRowBytes)) { return false; |