Make GMs with persistent SkImages that may be texture backed recreate
their images if the underlying GrContext is abandoned. Change-Id: Ibcb6aa25c3bb5a2f705d56c86382295449fe2d7a Reviewed-on: https://skia-review.googlesource.com/129983 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
5a5e08495e
commit
542685014b
@ -153,7 +153,7 @@ protected:
|
||||
}
|
||||
|
||||
void onDraw(SkCanvas* canvas) override {
|
||||
if (!fImage) {
|
||||
if (!fImage || !fImage->isValid(canvas->getGrContext())) {
|
||||
this->setupImage(canvas);
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ protected:
|
||||
}
|
||||
|
||||
void onDraw(SkCanvas* canvas) override {
|
||||
if (nullptr == fBitmap.pixelRef()) {
|
||||
if (nullptr == fBitmap.pixelRef() || !fImage->isValid(canvas->getGrContext())) {
|
||||
fImage = make_image(canvas, &fCenter);
|
||||
image_to_bitmap(fImage.get(), &fBitmap);
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ protected:
|
||||
}
|
||||
|
||||
void onDraw(SkCanvas* canvas) override {
|
||||
if (!fImage) {
|
||||
if (!fImage || !fImage->isValid(canvas->getGrContext())) {
|
||||
fImage = make_image(canvas, kCellSize, kCellSize);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user