discard scratch render targets when they are recycled.
Review URL: https://codereview.chromium.org/871373007
This commit is contained in:
parent
98b0315ad6
commit
66e09a87d4
@ -473,7 +473,12 @@ GrTexture* GrContext::refScratchTexture(const GrSurfaceDesc& inDesc, ScratchTexM
|
|||||||
}
|
}
|
||||||
GrGpuResource* resource = fResourceCache2->findAndRefScratchResource(key, scratchFlags);
|
GrGpuResource* resource = fResourceCache2->findAndRefScratchResource(key, scratchFlags);
|
||||||
if (resource) {
|
if (resource) {
|
||||||
return static_cast<GrSurface*>(resource)->asTexture();
|
GrSurface* surface = static_cast<GrSurface*>(resource);
|
||||||
|
GrRenderTarget* rt = surface->asRenderTarget();
|
||||||
|
if (rt && fGpu->caps()->discardRenderTargetSupport()) {
|
||||||
|
rt->discard();
|
||||||
|
}
|
||||||
|
return surface->asTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kExact_ScratchTexMatch == match) {
|
if (kExact_ScratchTexMatch == match) {
|
||||||
|
Loading…
Reference in New Issue
Block a user