Add a GrLayerCache to GrContext

https://codereview.chromium.org/217343006/



git-svn-id: http://skia.googlecode.com/svn/trunk@14038 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index c2f62d8..89548ab 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -18,6 +18,7 @@
 #include "GrDrawTargetCaps.h"
 #include "GrIndexBuffer.h"
 #include "GrInOrderDrawBuffer.h"
+#include "GrLayerCache.h"
 #include "GrOvalRenderer.h"
 #include "GrPathRenderer.h"
 #include "GrPathUtils.h"
@@ -124,6 +125,8 @@
 
     fFontCache = SkNEW_ARGS(GrFontCache, (fGpu));
 
+    fLayerCache.reset(SkNEW_ARGS(GrLayerCache, (fGpu)));
+
     fLastDrawWasBuffered = kNo_BufferedDraw;
 
     fAARectRenderer = SkNEW(GrAARectRenderer);
@@ -197,6 +200,7 @@
     fTextureCache->purgeAllUnlocked();
 
     fFontCache->freeAll();
+    fLayerCache->freeAll();
     fGpu->markContextDirty();
 }
 
@@ -214,6 +218,7 @@
 
     fTextureCache->purgeAllUnlocked();
     fFontCache->freeAll();
+    fLayerCache->freeAll();
     // a path renderer may be holding onto resources
     SkSafeSetNull(fPathRendererChain);
     SkSafeSetNull(fSoftwarePathRenderer);