commit | eaa862569dc91d55fc79d057df6e69b139e46888 | [log] [tgz] |
---|---|---|
author | Robert Phillips <robertphillips@google.com> | Tue Nov 08 13:49:39 2016 +0000 |
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | Tue Nov 08 13:49:49 2016 +0000 |
tree | 49c648f32f78e3f625b9338d675bd8fbcf340c1e | |
parent | 283eb302330e9b9a2f144f341ec12cac54590ebf [diff] [blame] |
Revert "Revert "Add GrRenderTargetContext instantiate & asTextureProxy"" This reverts commit 7d7d7d19462b75f5470492dc4820a02c1eba4af2. Reason for revert: Reverting this to see if it really was crashing on SVGs or if that was cross talk. Original change's description: > Revert "Add GrRenderTargetContext instantiate & asTextureProxy" > > This reverts commit 9113edfff89e657dabc0ba095c54f7720550196c. > > Reason for revert: Looks to be causing EXCEPTION_ACCESS_VIOLATION: > > https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug/builds/121/steps/test_skia%20on%20Windows/logs/stdio > https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-GCE-CPU-AVX2-x86-Debug/builds/2384/steps/test_skia%20on%20Windows-2008ServerR2-SP1/logs/stdio > https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug/builds/785/steps/test_skia%20on%20Windows/logs/stdio > > Original change's description: > > Add GrRenderTargetContext instantiate & asTextureProxy > > > > This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test. > > > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4494 > > > > Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324 > > Reviewed-on: https://skia-review.googlesource.com/4494 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Robert Phillips <robertphillips@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I225ce7867ebd445067e5ea55ebbfd587f7fe782a > Reviewed-on: https://skia-review.googlesource.com/4528 > Commit-Queue: Leon Scroggins <scroggo@google.com> > Reviewed-by: Leon Scroggins <scroggo@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,scroggo@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ifc3b9ac343009a3808f5f47500eef50df438e3d9 Reviewed-on: https://skia-review.googlesource.com/4537 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp index f428a0f..fcc5275 100644 --- a/src/gpu/GrRenderTargetProxy.cpp +++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -37,33 +37,17 @@ } GrRenderTarget* GrRenderTargetProxy::instantiate(GrTextureProvider* texProvider) { - if (fTarget) { - return fTarget->asRenderTarget(); - } + SkASSERT(fDesc.fFlags & GrSurfaceFlags::kRenderTarget_GrSurfaceFlag); - // TODO: it would be nice to not have to copy the desc here - GrSurfaceDesc desc = fDesc; - desc.fFlags |= GrSurfaceFlags::kRenderTarget_GrSurfaceFlag; - - if (SkBackingFit::kApprox == fFit) { - fTarget = texProvider->createApproxTexture(desc); - } else { - fTarget = texProvider->createTexture(desc, fBudgeted); - } - if (!fTarget) { + GrSurface* surf = INHERITED::instantiate(texProvider); + if (!surf || !surf->asRenderTarget()) { return nullptr; } -#ifdef SK_DEBUG - if (kInvalidGpuMemorySize != this->getRawGpuMemorySize_debugOnly()) { - SkASSERT(fTarget->gpuMemorySize() <= this->getRawGpuMemorySize_debugOnly()); - } -#endif - // Check that our a priori computation matched the ultimate reality - SkASSERT(fFlags == fTarget->asRenderTarget()->renderTargetPriv().flags()); + SkASSERT(fFlags == surf->asRenderTarget()->renderTargetPriv().flags()); - return fTarget->asRenderTarget(); + return surf->asRenderTarget(); }