Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: cc/resources/gpu_rasterizer.cc

Issue 1016733002: cc: Free gpu resources when we are invisible or TM is oom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/gpu_rasterizer.h" 5 #include "cc/resources/gpu_rasterizer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 canvas->save(); 184 canvas->save();
185 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(), 185 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(),
186 tile->contents_scale()); 186 tile->contents_scale());
187 canvas->restore(); 187 canvas->restore();
188 188
189 // Add the canvas and recorded picture to |multi_picture_draw_|. 189 // Add the canvas and recorded picture to |multi_picture_draw_|.
190 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); 190 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
191 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get()); 191 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get());
192 } 192 }
193 193
194 void GpuRasterizer::ClearCache() {
195 GrContext* gr_context = GetContextProvider(false)->GrContext();
vmiura 2015/03/19 21:20:35 For threaded GPU raster we need to take a lock on
sohanjg 2015/03/23 10:34:38 Done.
196 DCHECK(gr_context);
197 gr_context->setResourceCacheLimits(0, 0);
198 }
199
194 } // namespace cc 200 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698