diff options
author | 2016-04-20 10:33:27 -0700 | |
---|---|---|
committer | 2016-04-20 10:33:28 -0700 | |
commit | c3d706f7ce87cdd94158d2266ab2fe2f18f5020a (patch) | |
tree | b206d0bfc72e532c9a61c19fbd74ea4c8cfb5057 /src/gpu/gl/GrGLGpu.cpp | |
parent | 0d9e9bee17aa2901582c5461ae60f7241fc0cd59 (diff) |
Revert of Use transfer buffer for BatchAtlas texture copies (patchset #9 id:160001 of https://codereview.chromium.org/1888473002/ )
Reason for revert:
Lots of sync issues with paths and text.
Original issue's description:
> Use transfer buffer for BatchAtlas texture copies.
>
> Sets up use of transfer buffer (if available) to do one-copy transfers.
> Get transfer buffers working properly in GL.
> Implement GrVkGpu::onTransferPixels.
> Check caps to ensure we can create a transfer buffer.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1888473002
>
> Committed: https://skia.googlesource.com/skia/+/b0ec9836dbf7f2304a3a29289b818719ca0a39bd
TBR=robertphillips@google.com,egdaniel@google.com,bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1904723003
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index e50f1e2fdb..3a7f531476 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -895,13 +895,13 @@ bool GrGLGpu::onWritePixels(GrSurface* surface, return success; } -bool GrGLGpu::onTransferPixels(GrTexture* texture, +bool GrGLGpu::onTransferPixels(GrSurface* surface, int left, int top, int width, int height, GrPixelConfig config, GrBuffer* transferBuffer, size_t offset, size_t rowBytes) { - GrGLTexture* glTex = static_cast<GrGLTexture*>(texture); + GrGLTexture* glTex = static_cast<GrGLTexture*>(surface->asTexture()); - if (!check_write_and_transfer_input(glTex, texture, config)) { + if (!check_write_and_transfer_input(glTex, surface, config)) { return false; } @@ -920,16 +920,15 @@ bool GrGLGpu::onTransferPixels(GrTexture* texture, bool success = false; GrMipLevel mipLevel; - mipLevel.fPixels = (void*)offset; + mipLevel.fPixels = transferBuffer; mipLevel.fRowBytes = rowBytes; SkSTArray<1, GrMipLevel> texels; texels.push_back(mipLevel); success = this->uploadTexData(glTex->desc(), glTex->target(), kTransfer_UploadType, left, top, width, height, config, texels); - if (success) { SkIRect rect = SkIRect::MakeXYWH(left, top, width, height); - this->didWriteToSurface(texture, &rect); + this->didWriteToSurface(surface, &rect); return true; } @@ -1197,14 +1196,6 @@ bool GrGLGpu::uploadTexData(const GrSurfaceDesc& desc, SkASSERT(this->caps()->isConfigTexturable(desc.fConfig)); - // unbind any previous transfer buffer if not transferring - auto& xferBufferState = fHWBufferState[kXferCpuToGpu_GrBufferType]; - if (kTransfer_UploadType != uploadType && - SK_InvalidUniqueID != xferBufferState.fBoundBufferUniqueID) { - GL_CALL(BindBuffer(xferBufferState.fGLTarget, 0)); - xferBufferState.invalidate(); - } - // texels is const. // But we may need to flip the texture vertically to prepare it. // Rather than flip in place and alter the incoming data, |