ccpr: Delete the stashed atlas texture before allocating a new one
Bug: skia: Change-Id: I13c13c73f6065f2eababb174361f8bfa9e62b7e2 Reviewed-on: https://skia-review.googlesource.com/c/160200 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
parent
d037f4d204
commit
29b11d605f
@ -411,9 +411,12 @@ bool GrCCPerFlushResources::finalize(GrOnFlushResourceProvider* onFlushRP,
|
|||||||
if (stashedAtlasProxy && atlas->currentWidth() == stashedAtlasProxy->width() &&
|
if (stashedAtlasProxy && atlas->currentWidth() == stashedAtlasProxy->width() &&
|
||||||
atlas->currentHeight() == stashedAtlasProxy->height()) {
|
atlas->currentHeight() == stashedAtlasProxy->height()) {
|
||||||
backingTexture = sk_ref_sp(stashedAtlasProxy->peekTexture());
|
backingTexture = sk_ref_sp(stashedAtlasProxy->peekTexture());
|
||||||
stashedAtlasProxy = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete the stashed proxy here. That way, if we can't recycle the stashed atlas texture,
|
||||||
|
// we free this memory prior to allocating a new backing texture.
|
||||||
|
stashedAtlasProxy = nullptr;
|
||||||
|
|
||||||
if (auto rtc = atlas->makeRenderTargetContext(onFlushRP, std::move(backingTexture))) {
|
if (auto rtc = atlas->makeRenderTargetContext(onFlushRP, std::move(backingTexture))) {
|
||||||
auto op = RenderAtlasOp::Make(rtc->surfPriv().getContext(), sk_ref_sp(this),
|
auto op = RenderAtlasOp::Make(rtc->surfPriv().getContext(), sk_ref_sp(this),
|
||||||
atlas->getFillBatchID(), atlas->getStrokeBatchID(),
|
atlas->getFillBatchID(), atlas->getStrokeBatchID(),
|
||||||
|
Loading…
Reference in New Issue
Block a user