From cae27fed5e45e8899e56ece22b27e8958ffc0162 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Wed, 10 Jul 2013 10:14:35 +0000 Subject: Allow the resource cache to (indirectly) flush the InOrderDrawBuffer R=bsalomon@google.com Author: robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/18466005 git-svn-id: http://skia.googlecode.com/svn/trunk@9949 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/GrContext.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gpu/GrContext.cpp') diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 78220c0279..39d0db33b4 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -541,6 +541,20 @@ void GrContext::purgeCache() { } } +bool GrContext::OverbudgetCB(void* data) { + GrAssert(NULL != data); + + GrContext* context = reinterpret_cast(data); + + // Flush the InOrderDrawBuffer to possibly free up some textures + context->flush(); + + // TODO: actually track flush's behavior rather than always just + // returning true. + return true; +} + + GrTexture* GrContext::createUncachedTexture(const GrTextureDesc& descIn, void* srcData, size_t rowBytes) { -- cgit v1.2.3