diff options
author | 2017-07-28 11:56:47 -0400 | |
---|---|---|
committer | 2017-07-31 16:02:42 +0000 | |
commit | df0e09feacb29290fe94d37f921731b18f2edae0 (patch) | |
tree | 8059c31deb493e101b616578f6db0d4bc4d05438 /src/gpu/vk/GrVkGpu.cpp | |
parent | f57c0d67611186ba74179b53b421e64b63a579c7 (diff) |
Remove origin field from GrSurface
This mainly consists of rm origin from GrSurface and the wrapBackEnd*
methods and then re-adding an explicit origin parameter to all the
GrGpu methods that need it.
Change-Id: Iabd79ae98b227b5b9409f3ab5bbcc48af9613c18
Reviewed-on: https://skia-review.googlesource.com/26363
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkGpu.cpp')
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 141 |
1 files changed, 65 insertions, 76 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 31e55de46a..2f7cbe5551 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -332,7 +332,8 @@ GrBuffer* GrVkGpu::onCreateBuffer(size_t size, GrBufferType type, GrAccessPatter } //////////////////////////////////////////////////////////////////////////////// -bool GrVkGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, +bool GrVkGpu::onGetWritePixelsInfo(GrSurface* dstSurface, GrSurfaceOrigin dstOrigin, + int width, int height, GrPixelConfig srcConfig, DrawPreference* drawPreference, WritePixelTempDrawInfo* tempDrawInfo) { GrRenderTarget* renderTarget = dstSurface->asRenderTarget(); @@ -375,7 +376,7 @@ bool GrVkGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, return true; } -bool GrVkGpu::onWritePixels(GrSurface* surface, +bool GrVkGpu::onWritePixels(GrSurface* surface, GrSurfaceOrigin origin, int left, int top, int width, int height, GrPixelConfig config, const GrMipLevel texels[], int mipLevelCount) { @@ -410,7 +411,7 @@ bool GrVkGpu::onWritePixels(GrSurface* surface, false); this->submitCommandBuffer(kForce_SyncQueue); } - success = this->uploadTexDataLinear(vkTex, left, top, width, height, config, + success = this->uploadTexDataLinear(vkTex, origin, left, top, width, height, config, texels[0].fPixels, texels[0].fRowBytes); } else { int currentMipLevels = vkTex->texturePriv().maxMipMapLevel() + 1; @@ -419,7 +420,7 @@ bool GrVkGpu::onWritePixels(GrSurface* surface, return false; } } - success = this->uploadTexDataOptimal(vkTex, left, top, width, height, config, + success = this->uploadTexDataOptimal(vkTex, origin, left, top, width, height, config, texels, mipLevelCount); } @@ -487,8 +488,9 @@ bool GrVkGpu::onTransferPixels(GrTexture* texture, return true; } -void GrVkGpu::resolveImage(GrSurface* dst, GrVkRenderTarget* src, const SkIRect& srcRect, - const SkIPoint& dstPoint) { +void GrVkGpu::resolveImage(GrSurface* dst, GrSurfaceOrigin dstOrigin, + GrVkRenderTarget* src, GrSurfaceOrigin srcOrigin, + const SkIRect& srcRect, const SkIPoint& dstPoint) { SkASSERT(dst); SkASSERT(src && src->numColorSamples() > 1 && src->msaaImage()); @@ -500,8 +502,8 @@ void GrVkGpu::resolveImage(GrSurface* dst, GrVkRenderTarget* src, const SkIRect& SkIRect srcVkRect = srcRect; int32_t dstY = dstPoint.fY; - if (kBottomLeft_GrSurfaceOrigin == src->origin()) { - SkASSERT(kBottomLeft_GrSurfaceOrigin == dst->origin()); + if (kBottomLeft_GrSurfaceOrigin == srcOrigin) { + SkASSERT(kBottomLeft_GrSurfaceOrigin == dstOrigin); srcVkRect.fTop = src->height() - srcRect.fBottom; srcVkRect.fBottom = src->height() - srcRect.fTop; dstY = dst->height() - dstPoint.fY - srcVkRect.height(); @@ -538,7 +540,8 @@ void GrVkGpu::resolveImage(GrSurface* dst, GrVkRenderTarget* src, const SkIRect& fCurrentCmdBuffer->resolveImage(this, *src->msaaImage(), *dstImage, 1, &resolveInfo); } -void GrVkGpu::internalResolveRenderTarget(GrRenderTarget* target, bool requiresSubmit) { +void GrVkGpu::internalResolveRenderTarget(GrRenderTarget* target, GrSurfaceOrigin origin, + bool requiresSubmit) { if (target->needsResolve()) { SkASSERT(target->numColorSamples() > 1); GrVkRenderTarget* rt = static_cast<GrVkRenderTarget*>(target); @@ -546,7 +549,8 @@ void GrVkGpu::internalResolveRenderTarget(GrRenderTarget* target, bool requiresS const SkIRect& srcRect = rt->getResolveRect(); - this->resolveImage(target, rt, srcRect, SkIPoint::Make(srcRect.fLeft, srcRect.fTop)); + this->resolveImage(target, origin, rt, origin, srcRect, + SkIPoint::Make(srcRect.fLeft, srcRect.fTop)); rt->flagAsResolved(); @@ -556,7 +560,7 @@ void GrVkGpu::internalResolveRenderTarget(GrRenderTarget* target, bool requiresS } } -bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex, +bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex, GrSurfaceOrigin texOrigin, int left, int top, int width, int height, GrPixelConfig dataConfig, const void* data, @@ -592,7 +596,7 @@ bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex, &subres, &layout)); - int texTop = kBottomLeft_GrSurfaceOrigin == tex->origin() ? tex->height() - top - height : top; + int texTop = kBottomLeft_GrSurfaceOrigin == texOrigin ? tex->height() - top - height : top; const GrVkAlloc& alloc = tex->alloc(); VkDeviceSize offset = alloc.fOffset + texTop*layout.rowPitch + left*bpp; VkDeviceSize size = height*layout.rowPitch; @@ -602,7 +606,7 @@ bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex, return false; } - if (kBottomLeft_GrSurfaceOrigin == tex->origin()) { + if (kBottomLeft_GrSurfaceOrigin == texOrigin) { // copy into buffer by rows const char* srcRow = reinterpret_cast<const char*>(data); char* dstRow = reinterpret_cast<char*>(mapPtr)+(height - 1)*layout.rowPitch; @@ -622,7 +626,7 @@ bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex, return true; } -bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, +bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, GrSurfaceOrigin texOrigin, int left, int top, int width, int height, GrPixelConfig dataConfig, const GrMipLevel texels[], int mipLevelCount) { @@ -657,7 +661,7 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, } // Determine whether we need to flip when we copy into the buffer - bool flipY = (kBottomLeft_GrSurfaceOrigin == tex->origin() && mipLevelCount); + bool flipY = (kBottomLeft_GrSurfaceOrigin == texOrigin && mipLevelCount); SkTArray<size_t> individualMipOffsets(mipLevelCount); individualMipOffsets.push_back(0); @@ -813,8 +817,8 @@ sk_sp<GrTexture> GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted if (mipLevelCount) { SkASSERT(texels[0].fPixels); - if (!this->uploadTexDataOptimal(tex.get(), 0, 0, desc.fWidth, desc.fHeight, desc.fConfig, - texels, mipLevelCount)) { + if (!this->uploadTexDataOptimal(tex.get(), desc.fOrigin, 0, 0, desc.fWidth, desc.fHeight, + desc.fConfig, texels, mipLevelCount)) { tex->unref(); return nullptr; } @@ -849,15 +853,6 @@ bool GrVkGpu::updateBuffer(GrVkBuffer* buffer, const void* src, //////////////////////////////////////////////////////////////////////////////// -static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin) { - // By default, all textures in Vk use TopLeft - if (kDefault_GrSurfaceOrigin == origin) { - return kTopLeft_GrSurfaceOrigin; - } else { - return origin; - } -} - static bool check_backend_texture(const GrBackendTexture& backendTex) { const GrVkImageInfo* info = backendTex.getVkImageInfo(); if (!info) { @@ -873,7 +868,6 @@ static bool check_backend_texture(const GrBackendTexture& backendTex) { } sk_sp<GrTexture> GrVkGpu::onWrapBackendTexture(const GrBackendTexture& backendTex, - GrSurfaceOrigin origin, GrWrapOwnership ownership) { if (!check_backend_texture(backendTex)) { return nullptr; @@ -881,19 +875,16 @@ sk_sp<GrTexture> GrVkGpu::onWrapBackendTexture(const GrBackendTexture& backendTe GrSurfaceDesc surfDesc; surfDesc.fFlags = kNone_GrSurfaceFlags; + surfDesc.fOrigin = kTopLeft_GrSurfaceOrigin; // Not actually used in the following surfDesc.fWidth = backendTex.width(); surfDesc.fHeight = backendTex.height(); surfDesc.fConfig = backendTex.config(); surfDesc.fSampleCnt = 0; - // In GL, Chrome assumes all textures are BottomLeft - // In VK, we don't have this restriction - surfDesc.fOrigin = resolve_origin(origin); return GrVkTexture::MakeWrappedTexture(this, surfDesc, ownership, backendTex.getVkImageInfo()); } sk_sp<GrTexture> GrVkGpu::onWrapRenderableBackendTexture(const GrBackendTexture& backendTex, - GrSurfaceOrigin origin, int sampleCnt, GrWrapOwnership ownership) { if (!check_backend_texture(backendTex)) { @@ -902,20 +893,17 @@ sk_sp<GrTexture> GrVkGpu::onWrapRenderableBackendTexture(const GrBackendTexture& GrSurfaceDesc surfDesc; surfDesc.fFlags = kRenderTarget_GrSurfaceFlag; + surfDesc.fOrigin = kBottomLeft_GrSurfaceOrigin; // Not actually used in the following surfDesc.fWidth = backendTex.width(); surfDesc.fHeight = backendTex.height(); surfDesc.fConfig = backendTex.config(); surfDesc.fSampleCnt = this->caps()->getSampleCount(sampleCnt, backendTex.config()); - // In GL, Chrome assumes all textures are BottomLeft - // In VK, we don't have this restriction - surfDesc.fOrigin = resolve_origin(origin); return GrVkTextureRenderTarget::MakeWrappedTextureRenderTarget(this, surfDesc, ownership, backendTex.getVkImageInfo()); } -sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTarget& backendRT, - GrSurfaceOrigin origin){ +sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTarget& backendRT){ // Currently the Vulkan backend does not support wrapping of msaa render targets directly. In // general this is not an issue since swapchain images in vulkan are never multisampled. Thus if // you want a multisampled RT it is best to wrap the swapchain images and then let Skia handle @@ -934,8 +922,7 @@ sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTa GrSurfaceDesc desc; desc.fFlags = kRenderTarget_GrSurfaceFlag; - SkASSERT(kDefault_GrSurfaceOrigin != origin); - desc.fOrigin = origin; + desc.fOrigin = kBottomLeft_GrSurfaceOrigin; // Not actually used in the following desc.fWidth = backendRT.width(); desc.fHeight = backendRT.height(); desc.fConfig = backendRT.config(); @@ -951,7 +938,6 @@ sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTa } sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTexture& tex, - GrSurfaceOrigin origin, int sampleCnt) { const GrVkImageInfo* info = tex.getVkImageInfo(); @@ -964,7 +950,7 @@ sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendTextureAsRenderTarget(const GrBacken GrSurfaceDesc desc; desc.fFlags = kRenderTarget_GrSurfaceFlag; - desc.fOrigin = resolve_origin(origin); + desc.fOrigin = kBottomLeft_GrSurfaceOrigin; // Not actually used in the following desc.fWidth = tex.width(); desc.fHeight = tex.height(); desc.fConfig = tex.config(); @@ -974,7 +960,7 @@ sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendTextureAsRenderTarget(const GrBacken return tgt; } -void GrVkGpu::generateMipmap(GrVkTexture* tex) { +void GrVkGpu::generateMipmap(GrVkTexture* tex, GrSurfaceOrigin texOrigin) { // don't do anything for linearly tiled textures (can't have mipmaps) if (tex->isLinearTiled()) { SkDebugf("Trying to create mipmap for linear tiled texture"); @@ -996,7 +982,7 @@ void GrVkGpu::generateMipmap(GrVkTexture* tex) { // We may need to resolve the texture first if it is also a render target GrVkRenderTarget* texRT = static_cast<GrVkRenderTarget*>(tex->asRenderTarget()); if (texRT) { - this->internalResolveRenderTarget(texRT, false); + this->internalResolveRenderTarget(texRT, texOrigin, false); } int width = tex->width(); @@ -1504,8 +1490,8 @@ void GrVkGpu::clearStencil(GrRenderTarget* target) { fCurrentCmdBuffer->clearDepthStencilImage(this, vkStencil, &vkStencilColor, 1, &subRange); } -inline bool can_copy_image(const GrSurface* dst, - const GrSurface* src, +inline bool can_copy_image(const GrSurface* dst, GrSurfaceOrigin dstOrigin, + const GrSurface* src, GrSurfaceOrigin srcOrigin, const GrVkGpu* gpu) { const GrRenderTarget* dstRT = dst->asRenderTarget(); const GrRenderTarget* srcRT = src->asRenderTarget(); @@ -1525,7 +1511,7 @@ inline bool can_copy_image(const GrSurface* dst, // We require that all vulkan GrSurfaces have been created with transfer_dst and transfer_src // as image usage flags. - if (src->origin() == dst->origin() && + if (srcOrigin == dstOrigin && GrBytesPerPixel(src->config()) == GrBytesPerPixel(dst->config())) { return true; } @@ -1533,13 +1519,13 @@ inline bool can_copy_image(const GrSurface* dst, return false; } -void GrVkGpu::copySurfaceAsCopyImage(GrSurface* dst, - GrSurface* src, +void GrVkGpu::copySurfaceAsCopyImage(GrSurface* dst, GrSurfaceOrigin dstOrigin, + GrSurface* src, GrSurfaceOrigin srcOrigin, GrVkImage* dstImage, GrVkImage* srcImage, const SkIRect& srcRect, const SkIPoint& dstPoint) { - SkASSERT(can_copy_image(dst, src, this)); + SkASSERT(can_copy_image(dst, dstOrigin, src, srcOrigin, this)); // These flags are for flushing/invalidating caches and for the dst image it doesn't matter if // the cache is flushed since it is only being written to. @@ -1559,8 +1545,8 @@ void GrVkGpu::copySurfaceAsCopyImage(GrSurface* dst, SkIRect srcVkRect = srcRect; int32_t dstY = dstPoint.fY; - if (kBottomLeft_GrSurfaceOrigin == src->origin()) { - SkASSERT(kBottomLeft_GrSurfaceOrigin == dst->origin()); + if (kBottomLeft_GrSurfaceOrigin == srcOrigin) { + SkASSERT(kBottomLeft_GrSurfaceOrigin == dstOrigin); srcVkRect.fTop = src->height() - srcRect.fBottom; srcVkRect.fBottom = src->height() - srcRect.fTop; dstY = dst->height() - dstPoint.fY - srcVkRect.height(); @@ -1610,8 +1596,8 @@ inline bool can_copy_as_blit(const GrSurface* dst, return true; } -void GrVkGpu::copySurfaceAsBlit(GrSurface* dst, - GrSurface* src, +void GrVkGpu::copySurfaceAsBlit(GrSurface* dst, GrSurfaceOrigin dstOrigin, + GrSurface* src, GrSurfaceOrigin srcOrigin, GrVkImage* dstImage, GrVkImage* srcImage, const SkIRect& srcRect, @@ -1638,7 +1624,7 @@ void GrVkGpu::copySurfaceAsBlit(GrSurface* dst, dstRect.fLeft = dstPoint.fX; dstRect.fRight = dstPoint.fX + srcRect.width(); - if (kBottomLeft_GrSurfaceOrigin == src->origin()) { + if (kBottomLeft_GrSurfaceOrigin == srcOrigin) { srcVkRect.fTop = src->height() - srcRect.fBottom; srcVkRect.fBottom = src->height() - srcRect.fTop; } else { @@ -1646,7 +1632,7 @@ void GrVkGpu::copySurfaceAsBlit(GrSurface* dst, srcVkRect.fBottom = srcRect.fBottom; } - if (kBottomLeft_GrSurfaceOrigin == dst->origin()) { + if (kBottomLeft_GrSurfaceOrigin == dstOrigin) { dstRect.fTop = dst->height() - dstPoint.fY - srcVkRect.height(); } else { dstRect.fTop = dstPoint.fY; @@ -1655,7 +1641,7 @@ void GrVkGpu::copySurfaceAsBlit(GrSurface* dst, // If we have different origins, we need to flip the top and bottom of the dst rect so that we // get the correct origintation of the copied data. - if (src->origin() != dst->origin()) { + if (srcOrigin != dstOrigin) { SkTSwap(dstRect.fTop, dstRect.fBottom); } @@ -1678,8 +1664,8 @@ void GrVkGpu::copySurfaceAsBlit(GrSurface* dst, this->didWriteToSurface(dst, &dstRect); } -inline bool can_copy_as_resolve(const GrSurface* dst, - const GrSurface* src, +inline bool can_copy_as_resolve(const GrSurface* dst, GrSurfaceOrigin dstOrigin, + const GrSurface* src, GrSurfaceOrigin srcOrigin, const GrVkGpu* gpu) { // Our src must be a multisampled render target if (!src->asRenderTarget() || src->asRenderTarget()->numColorSamples() <= 1) { @@ -1694,27 +1680,27 @@ inline bool can_copy_as_resolve(const GrSurface* dst, } // Surfaces must have the same origin. - if (src->origin() != dst->origin()) { + if (srcOrigin != dstOrigin) { return false; } return true; } -void GrVkGpu::copySurfaceAsResolve(GrSurface* dst, - GrSurface* src, +void GrVkGpu::copySurfaceAsResolve(GrSurface* dst, GrSurfaceOrigin dstOrigin, + GrSurface* src, GrSurfaceOrigin srcOrigin, const SkIRect& srcRect, const SkIPoint& dstPoint) { GrVkRenderTarget* srcRT = static_cast<GrVkRenderTarget*>(src->asRenderTarget()); - this->resolveImage(dst, srcRT, srcRect, dstPoint); + this->resolveImage(dst, dstOrigin, srcRT, srcOrigin, srcRect, dstPoint); } -bool GrVkGpu::onCopySurface(GrSurface* dst, - GrSurface* src, +bool GrVkGpu::onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin, + GrSurface* src, GrSurfaceOrigin srcOrigin, const SkIRect& srcRect, const SkIPoint& dstPoint) { - if (can_copy_as_resolve(dst, src, this)) { - this->copySurfaceAsResolve(dst, src, srcRect, dstPoint); + if (can_copy_as_resolve(dst, dstOrigin, src, srcOrigin, this)) { + this->copySurfaceAsResolve(dst, dstOrigin, src, srcOrigin, srcRect, dstPoint); return true; } @@ -1722,7 +1708,7 @@ bool GrVkGpu::onCopySurface(GrSurface* dst, this->submitCommandBuffer(GrVkGpu::kSkip_SyncQueue); } - if (fCopyManager.copySurfaceAsDraw(this, dst, src, srcRect, dstPoint)) { + if (fCopyManager.copySurfaceAsDraw(this, dst, dstOrigin, src, srcOrigin, srcRect, dstPoint)) { return true; } @@ -1750,27 +1736,30 @@ bool GrVkGpu::onCopySurface(GrSurface* dst, return false; } - if (can_copy_image(dst, src, this)) { - this->copySurfaceAsCopyImage(dst, src, dstImage, srcImage, srcRect, dstPoint); + if (can_copy_image(dst, dstOrigin, src, srcOrigin, this)) { + this->copySurfaceAsCopyImage(dst, dstOrigin, src, srcOrigin, dstImage, srcImage, + srcRect, dstPoint); return true; } if (can_copy_as_blit(dst, src, dstImage, srcImage, this)) { - this->copySurfaceAsBlit(dst, src, dstImage, srcImage, srcRect, dstPoint); + this->copySurfaceAsBlit(dst, dstOrigin, src, srcOrigin, dstImage, srcImage, + srcRect, dstPoint); return true; } return false; } -void GrVkGpu::onQueryMultisampleSpecs(GrRenderTarget* rt, const GrStencilSettings&, +void GrVkGpu::onQueryMultisampleSpecs(GrRenderTarget* rt, GrSurfaceOrigin, const GrStencilSettings&, int* effectiveSampleCnt, SamplePattern*) { // TODO: stub. SkASSERT(!this->caps()->sampleLocationsSupport()); *effectiveSampleCnt = rt->numStencilSamples(); } -bool GrVkGpu::onGetReadPixelsInfo(GrSurface* srcSurface, int width, int height, size_t rowBytes, +bool GrVkGpu::onGetReadPixelsInfo(GrSurface* srcSurface, GrSurfaceOrigin srcOrigin, + int width, int height, size_t rowBytes, GrPixelConfig readConfig, DrawPreference* drawPreference, ReadPixelTempDrawInfo* tempDrawInfo) { // These settings we will always want if a temp draw is performed. @@ -1803,7 +1792,7 @@ bool GrVkGpu::onGetReadPixelsInfo(GrSurface* srcSurface, int width, int height, return true; } -bool GrVkGpu::onReadPixels(GrSurface* surface, +bool GrVkGpu::onReadPixels(GrSurface* surface, GrSurfaceOrigin origin, int left, int top, int width, int height, GrPixelConfig config, void* buffer, @@ -1823,7 +1812,7 @@ bool GrVkGpu::onReadPixels(GrSurface* surface, case GrVkRenderTarget::kAutoResolves_ResolveType: break; case GrVkRenderTarget::kCanResolve_ResolveType: - this->internalResolveRenderTarget(rt, false); + this->internalResolveRenderTarget(rt, origin, false); break; default: SkFAIL("Unknown resolve type"); @@ -1846,7 +1835,7 @@ bool GrVkGpu::onReadPixels(GrSurface* surface, size_t bpp = GrBytesPerPixel(config); size_t tightRowBytes = bpp * width; - bool flipY = kBottomLeft_GrSurfaceOrigin == surface->origin(); + bool flipY = kBottomLeft_GrSurfaceOrigin == origin; VkBufferImageCopy region; memset(®ion, 0, sizeof(VkBufferImageCopy)); @@ -1970,11 +1959,11 @@ void adjust_bounds_to_granularity(SkIRect* dstBounds, const SkIRect& srcBounds, void GrVkGpu::submitSecondaryCommandBuffer(const SkTArray<GrVkSecondaryCommandBuffer*>& buffers, const GrVkRenderPass* renderPass, const VkClearValue* colorClear, - GrVkRenderTarget* target, + GrVkRenderTarget* target, GrSurfaceOrigin origin, const SkIRect& bounds) { const SkIRect* pBounds = &bounds; SkIRect flippedBounds; - if (kBottomLeft_GrSurfaceOrigin == target->origin()) { + if (kBottomLeft_GrSurfaceOrigin == origin) { flippedBounds = bounds; flippedBounds.fTop = target->height() - bounds.fBottom; flippedBounds.fBottom = target->height() - bounds.fTop; |