diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-16 17:22:51 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-16 17:22:51 +0000 |
commit | b0ce4b6fc8da4c3aa491fc43512e9187df1dfdae (patch) | |
tree | ffac3dd41d1e4498c3c3afb3967bbd0aecdb2617 | |
parent | 684b3d0e3ca1ba07e9ce64793501ee69dcbb1775 (diff) |
Fix Gpu texture creation bug
When creating a resizedTexture on a device that doesn't support non power of 2 tile (Tegras),
we were creating the new stretched texture but were not actually saving the result
BUG=skia:2561
R=bsalomon@google.com, robertphillips@google.com, jvanverth@google.com
Author: egdaniel@google.com
Review URL: https://codereview.chromium.org/284303005
git-svn-id: http://skia.googlecode.com/svn/trunk@14765 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/gpu/GrContext.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 4b37c60a27..baa002a54a 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -268,13 +268,13 @@ GrStencilBuffer* GrContext::findStencilBuffer(int width, int height, return static_cast<GrStencilBuffer*>(resource); } -static void stretchImage(void* dst, - int dstW, - int dstH, - void* src, - int srcW, - int srcH, - size_t bpp) { +static void stretch_image(void* dst, + int dstW, + int dstH, + void* src, + int srcW, + int srcH, + size_t bpp) { SkFixed dx = (srcW << 16) / dstW; SkFixed dy = (srcH << 16) / dstH; @@ -364,13 +364,12 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc, rtDesc.fHeight = GrNextPow2(desc.fHeight); size_t bpp = GrBytesPerPixel(desc.fConfig); SkAutoSMalloc<128*128*4> stretchedPixels(bpp * rtDesc.fWidth * rtDesc.fHeight); - stretchImage(stretchedPixels.get(), rtDesc.fWidth, rtDesc.fHeight, - srcData, desc.fWidth, desc.fHeight, bpp); + stretch_image(stretchedPixels.get(), rtDesc.fWidth, rtDesc.fHeight, + srcData, desc.fWidth, desc.fHeight, bpp); size_t stretchedRowBytes = rtDesc.fWidth * bpp; - SkDEBUGCODE(GrTexture* texture = )fGpu->createTexture(rtDesc, stretchedPixels.get(), - stretchedRowBytes); + texture = fGpu->createTexture(rtDesc, stretchedPixels.get(), stretchedRowBytes); SkASSERT(NULL != texture); } |