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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 408923002: Add auto purging for SkPicture-related Ganesh resources (esp. layers) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comment Created 6 years, 5 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
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 } 2379 }
2380 2380
2381 /////////////////////////////////////////////////////////////////////////////// 2381 ///////////////////////////////////////////////////////////////////////////////
2382 void SkCanvas::EXPERIMENTAL_optimize(const SkPicture* picture) { 2382 void SkCanvas::EXPERIMENTAL_optimize(const SkPicture* picture) {
2383 SkBaseDevice* device = this->getDevice(); 2383 SkBaseDevice* device = this->getDevice();
2384 if (NULL != device) { 2384 if (NULL != device) {
2385 device->EXPERIMENTAL_optimize(picture); 2385 device->EXPERIMENTAL_optimize(picture);
2386 } 2386 }
2387 } 2387 }
2388 2388
2389 void SkCanvas::EXPERIMENTAL_purge(const SkPicture* picture) {
2390 SkBaseDevice* device = this->getTopDevice();
2391 if (NULL != device) {
2392 device->EXPERIMENTAL_purge(picture);
2393 }
2394 }
2395
2396 void SkCanvas::drawPicture(const SkPicture* picture) { 2389 void SkCanvas::drawPicture(const SkPicture* picture) {
2397 if (NULL != picture) { 2390 if (NULL != picture) {
2398 this->onDrawPicture(picture); 2391 this->onDrawPicture(picture);
2399 } 2392 }
2400 } 2393 }
2401 2394
2402 void SkCanvas::onDrawPicture(const SkPicture* picture) { 2395 void SkCanvas::onDrawPicture(const SkPicture* picture) {
2403 SkASSERT(NULL != picture); 2396 SkASSERT(NULL != picture);
2404 2397
2405 SkBaseDevice* device = this->getTopDevice(); 2398 SkBaseDevice* device = this->getTopDevice();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 if (!supported_for_raster_canvas(info)) { 2495 if (!supported_for_raster_canvas(info)) {
2503 return NULL; 2496 return NULL;
2504 } 2497 }
2505 2498
2506 SkBitmap bitmap; 2499 SkBitmap bitmap;
2507 if (!bitmap.installPixels(info, pixels, rowBytes)) { 2500 if (!bitmap.installPixels(info, pixels, rowBytes)) {
2508 return NULL; 2501 return NULL;
2509 } 2502 }
2510 return SkNEW_ARGS(SkCanvas, (bitmap)); 2503 return SkNEW_ARGS(SkCanvas, (bitmap));
2511 } 2504 }
OLDNEW
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698