2248 void destroyLayers(final View view) {
2249 if (view != null) {
2250 safelyRun(new Runnable() {
2251 @Override
2252 public void run() {
2253 if (mCanvas != null) {
2254 mCanvas.clearLayerUpdates();
2255 }
2256 destroyHardwareLayer(view);
2257 GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS);
2258 }
2259 });
2260 }
2261 }
2276 @Override
2277 void destroyHardwareResources(final View view) {
2278 if (view != null) {
2279 safelyRun(new Runnable() {
2280 @Override
2281 public void run() {
2282 if (mCanvas != null) {
2283 mCanvas.clearLayerUpdates();
2284 }
2285 destroyResources(view);
2286 GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS);
2287 }
2288 });
2289 }
2290 }
2312 static void startTrimMemory(int level) {
2313 if (sEgl == null || sEglConfig == null) return;
2314
2315 Gl20RendererEglContext managedContext =
2316 (Gl20RendererEglContext) sEglContextStorage.get();
2317
2318 if (managedContext == null) {
2319 return;
2320 } else {
2321 usePbufferSurface(managedContext.getContext());
2322 }
2323
2324 if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
2325 GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_FULL); <=====
2326 } else if (level >= ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
2327 GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_MODERATE); <=====
2328 }
2329 }