diff options
author | Greg Daniel <egdaniel@google.com> | 2017-05-01 13:50:58 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-01 14:14:50 +0000 |
commit | bcf612b5d0032f09d58c2ea5671de977130395db (patch) | |
tree | 1793afbbdb1b1cdc2be3e7de960ca9c76b6806d0 /src/gpu/GrBackendSurface.cpp | |
parent | 53f77bd4fdd76525b66b7f26d1c5c550858120df (diff) |
Revert "Revert "Plumb the use of GrBackendRenderTarget throughout Skia""
This reverts commit e3bd422fafc74dd3410c3de24a576635be92c3b4.
Reason for revert: Pre-req changes have all landed in other projects at this point.
Original change's description:
> Revert "Plumb the use of GrBackendRenderTarget throughout Skia"
>
> This reverts commit fdd77daedbba3b7c53be74a82fb9fae891b51696.
>
> Reason for revert: Apparently I have a few more build files to update before this can land.
>
> Original change's description:
> > Plumb the use of GrBackendRenderTarget throughout Skia
> >
> > Bug: skia:
> > Change-Id: Ib99a58d9552f5c7b8d77c09dcc72fa88326c26aa
> > Reviewed-on: https://skia-review.googlesource.com/14148
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I984e1909870182474c4c3cce257f01b6a9d8581f
> Reviewed-on: https://skia-review.googlesource.com/14531
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ib7ab94aada8a7cb80fe38f24daf32f9208c5b169
Reviewed-on: https://skia-review.googlesource.com/14826
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrBackendSurface.cpp')
-rw-r--r-- | src/gpu/GrBackendSurface.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/gpu/GrBackendSurface.cpp b/src/gpu/GrBackendSurface.cpp index 97b3b6ee03..6a1448e17c 100644 --- a/src/gpu/GrBackendSurface.cpp +++ b/src/gpu/GrBackendSurface.cpp @@ -70,14 +70,14 @@ GrBackendRenderTarget::GrBackendRenderTarget(int width, int height, int sampleCnt, int stencilBits, - const GrVkImageInfo* vkInfo) + const GrVkImageInfo& vkInfo) : fWidth(width) , fHeight(height) , fSampleCnt(sampleCnt) , fStencilBits(stencilBits) , fConfig( #ifdef SK_VULKAN - GrVkFormatToPixelConfig(vkInfo->fFormat) + GrVkFormatToPixelConfig(vkInfo.fFormat) #else kUnknown_GrPixelConfig #endif @@ -90,7 +90,7 @@ GrBackendRenderTarget::GrBackendRenderTarget(int width, int sampleCnt, int stencilBits, GrPixelConfig config, - const GrGLTextureInfo* glInfo) + const GrGLFramebufferInfo& glInfo) : fWidth(width) , fHeight(height) , fSampleCnt(sampleCnt) @@ -105,26 +105,33 @@ GrBackendRenderTarget::GrBackendRenderTarget(const GrBackendRenderTargetDesc& de , fHeight(desc.fHeight) , fSampleCnt(desc.fSampleCnt) , fStencilBits(desc.fStencilBits) - , fConfig(kVulkan_GrBackend == backend + , fConfig(desc.fConfig) + , fBackend(backend) { + if (kOpenGL_GrBackend == backend) { + fGLInfo = *reinterpret_cast<const GrGLFramebufferInfo*>(desc.fRenderTargetHandle); + } else { + SkASSERT(kVulkan_GrBackend == backend); #ifdef SK_VULKAN - ? GrVkFormatToPixelConfig(((GrVkImageInfo*)desc.fRenderTargetHandle)->fFormat) + const GrVkImageInfo* vkInfo = + reinterpret_cast<const GrVkImageInfo*>(desc.fRenderTargetHandle); + fConfig = GrVkFormatToPixelConfig(vkInfo->fFormat); + fVkInfo = *vkInfo; #else - ? kUnknown_GrPixelConfig + fConfig = kUnknown_GrPixelConfig; #endif - : desc.fConfig) - , fBackend(backend) - , fHandle(desc.fRenderTargetHandle) {} + } +} const GrVkImageInfo* GrBackendRenderTarget::getVkImageInfo() const { if (kVulkan_GrBackend == fBackend) { - return fVkInfo; + return &fVkInfo; } return nullptr; } -const GrGLTextureInfo* GrBackendRenderTarget::getGLTextureInfo() const { +const GrGLFramebufferInfo* GrBackendRenderTarget::getGLFramebufferInfo() const { if (kOpenGL_GrBackend == fBackend) { - return fGLInfo; + return &fGLInfo; } return nullptr; } |