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
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 78220c0..39d0db3 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -541,6 +541,20 @@
}
}
+bool GrContext::OverbudgetCB(void* data) {
+ GrAssert(NULL != data);
+
+ GrContext* context = reinterpret_cast<GrContext*>(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) {