Add plot-based purging to GrLayerCache

This CL allows a GrPlot full of atlased layer to be purged from the atlas to make room for new layers.

R=jvanverth@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/411703003
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index c35ff41..0abf9d8 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -38,6 +38,7 @@
 #include "SkTLazy.h"
 #include "SkUtils.h"
 #include "SkVertState.h"
+#include "SkXfermode.h"
 #include "SkErrorInternals.h"
 
 #define CACHE_COMPATIBLE_DEVICE_TEXTURES 1
@@ -2023,6 +2024,7 @@
                     // TODO: ensure none of the atlased layers contain a clear call!
                     SkPaint paint;
                     paint.setColor(SK_ColorTRANSPARENT);
+                    paint.setXfermode(SkXfermode::Create(SkXfermode::kSrc_Mode))->unref();
                     canvas->drawRect(bound, paint);
                 } else {
                     canvas->clear(SK_ColorTRANSPARENT);