Merge pull request #2329 from jason-simmons/suspend_skia_crash
Clear the Flow raster cache when a GrContext is destroyed
This commit is contained in:
@@ -49,4 +49,8 @@ PaintContext::ScopedFrame::~ScopedFrame() {
|
||||
PaintContext::~PaintContext() {
|
||||
}
|
||||
|
||||
void PaintContext::OnGrContextDestroyed() {
|
||||
raster_cache_.Clear();
|
||||
}
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -51,6 +51,8 @@ class PaintContext {
|
||||
SkCanvas& canvas,
|
||||
bool instrumentation_enabled = true);
|
||||
|
||||
void OnGrContextDestroyed();
|
||||
|
||||
RasterCache& raster_cache() { return raster_cache_; }
|
||||
const instrumentation::Counter& frame_count() const { return frame_count_; }
|
||||
const instrumentation::Stopwatch& frame_time() const { return frame_time_; }
|
||||
|
||||
@@ -112,4 +112,8 @@ void RasterCache::SweepAfterFrame() {
|
||||
cache_.erase(it);
|
||||
}
|
||||
|
||||
void RasterCache::Clear() {
|
||||
cache_.clear();
|
||||
}
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -25,6 +25,8 @@ class RasterCache {
|
||||
GrContext* context, SkPicture* picture, const SkMatrix& ctm);
|
||||
void SweepAfterFrame();
|
||||
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
struct Entry {
|
||||
Entry();
|
||||
|
||||
Reference in New Issue
Block a user