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

Side by Side Diff: src/gpu/GrContext.cpp

Issue 1032873002: Add mechanism to proactively purge old resources in GrResourceCache. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase to tot Created 5 years, 8 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 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrContext.h" 9 #include "GrContext.h"
10 10
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 void GrContext::flush(int flagsBitfield) { 1453 void GrContext::flush(int flagsBitfield) {
1454 if (NULL == fDrawBuffer) { 1454 if (NULL == fDrawBuffer) {
1455 return; 1455 return;
1456 } 1456 }
1457 1457
1458 if (kDiscard_FlushBit & flagsBitfield) { 1458 if (kDiscard_FlushBit & flagsBitfield) {
1459 fDrawBuffer->reset(); 1459 fDrawBuffer->reset();
1460 } else { 1460 } else {
1461 fDrawBuffer->flush(); 1461 fDrawBuffer->flush();
1462 } 1462 }
1463 fResourceCache->notifyFlushOccurred();
1463 fFlushToReduceCacheSize = false; 1464 fFlushToReduceCacheSize = false;
1464 } 1465 }
1465 1466
1466 bool sw_convert_to_premul(GrPixelConfig srcConfig, int width, int height, size_t inRowBytes, 1467 bool sw_convert_to_premul(GrPixelConfig srcConfig, int width, int height, size_t inRowBytes,
1467 const void* inPixels, size_t outRowBytes, void* outPix els) { 1468 const void* inPixels, size_t outRowBytes, void* outPix els) {
1468 SkSrcPixelInfo srcPI; 1469 SkSrcPixelInfo srcPI;
1469 if (!GrPixelConfig2ColorAndProfileType(srcConfig, &srcPI.fColorType, NULL)) { 1470 if (!GrPixelConfig2ColorAndProfileType(srcConfig, &srcPI.fColorType, NULL)) {
1470 return false; 1471 return false;
1471 } 1472 }
1472 srcPI.fAlphaType = kUnpremul_SkAlphaType; 1473 srcPI.fAlphaType = kUnpremul_SkAlphaType;
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 } 2000 }
2000 } 2001 }
2001 2002
2002 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { 2003 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) {
2003 fGpu->removeGpuTraceMarker(marker); 2004 fGpu->removeGpuTraceMarker(marker);
2004 if (fDrawBuffer) { 2005 if (fDrawBuffer) {
2005 fDrawBuffer->removeGpuTraceMarker(marker); 2006 fDrawBuffer->removeGpuTraceMarker(marker);
2006 } 2007 }
2007 } 2008 }
2008 2009
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698