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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 275563005: cleanup GrContext resource cache api (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix use of SK_ATTR_DEPRECATED Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrContext.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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 #include "SampleApp.h" 7 #include "SampleApp.h"
8 8
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after
1856 #if SK_SUPPORT_GPU 1856 #if SK_SUPPORT_GPU
1857 case '\\': 1857 case '\\':
1858 this->setDeviceType(kNullGPU_DeviceType); 1858 this->setDeviceType(kNullGPU_DeviceType);
1859 this->inval(NULL); 1859 this->inval(NULL);
1860 this->updateTitle(); 1860 this->updateTitle();
1861 return true; 1861 return true;
1862 case 'p': 1862 case 'p':
1863 { 1863 {
1864 GrContext* grContext = this->getGrContext(); 1864 GrContext* grContext = this->getGrContext();
1865 if (grContext) { 1865 if (grContext) {
1866 size_t cacheBytes = grContext->getGpuTextureCacheBytes(); 1866 size_t cacheBytes;
1867 grContext->getResourceCacheUsage(NULL, &cacheBytes);
1867 grContext->freeGpuResources(); 1868 grContext->freeGpuResources();
1868 SkDebugf("Purged %d bytes from the GPU resource cache.\n", 1869 SkDebugf("Purged %d bytes from the GPU resource cache.\n", c acheBytes);
1869 cacheBytes);
1870 } 1870 }
1871 } 1871 }
1872 return true; 1872 return true;
1873 #endif 1873 #endif
1874 default: 1874 default:
1875 break; 1875 break;
1876 } 1876 }
1877 1877
1878 if (fAppMenu->handleKeyEquivalent(uni)|| fSlideMenu->handleKeyEquivalent(uni )) { 1878 if (fAppMenu->handleKeyEquivalent(uni)|| fSlideMenu->handleKeyEquivalent(uni )) {
1879 this->onUpdateMenu(fAppMenu); 1879 this->onUpdateMenu(fAppMenu);
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
2558 SkGraphics::Init(); 2558 SkGraphics::Init();
2559 SkEvent::Init(); 2559 SkEvent::Init();
2560 } 2560 }
2561 2561
2562 // FIXME: this should be in a header 2562 // FIXME: this should be in a header
2563 void application_term(); 2563 void application_term();
2564 void application_term() { 2564 void application_term() {
2565 SkEvent::Term(); 2565 SkEvent::Term();
2566 SkGraphics::Term(); 2566 SkGraphics::Term();
2567 } 2567 }
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698