| Index: src/gpu/GrContext.cpp
 | 
| diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
 | 
| index b361b671c3b3080b9373ee30a76daf9ce91d7b7a..3f40c201f4088640bac8b6d998ebcfe97baed3a9 100755
 | 
| --- a/src/gpu/GrContext.cpp
 | 
| +++ b/src/gpu/GrContext.cpp
 | 
| @@ -13,7 +13,6 @@
 | 
|  #include "GrBatch.h"
 | 
|  #include "GrBatchFontCache.h"
 | 
|  #include "GrBatchTarget.h"
 | 
| -#include "GrBufferAllocPool.h"
 | 
|  #include "GrDefaultGeoProcFactory.h"
 | 
|  #include "GrGpuResource.h"
 | 
|  #include "GrGpuResourcePriv.h"
 | 
| @@ -50,12 +49,6 @@
 | 
|  #include "effects/GrDashingEffect.h"
 | 
|  #include "effects/GrSingleTextureEffect.h"
 | 
|  
 | 
| -static const size_t DRAW_BUFFER_VBPOOL_BUFFER_SIZE = 1 << 15;
 | 
| -static const int DRAW_BUFFER_VBPOOL_PREALLOC_BUFFERS = 4;
 | 
| -
 | 
| -static const size_t DRAW_BUFFER_IBPOOL_BUFFER_SIZE = 1 << 11;
 | 
| -static const int DRAW_BUFFER_IBPOOL_PREALLOC_BUFFERS = 4;
 | 
| -
 | 
|  #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this)
 | 
|  #define RETURN_IF_ABANDONED if (!fDrawBuffer) { return; }
 | 
|  #define RETURN_FALSE_IF_ABANDONED if (!fDrawBuffer) { return false; }
 | 
| @@ -100,8 +93,6 @@ GrContext::GrContext(const Options& opts) : fOptions(opts) {
 | 
|      fSoftwarePathRenderer = NULL;
 | 
|      fBatchFontCache = NULL;
 | 
|      fDrawBuffer = NULL;
 | 
| -    fDrawBufferVBAllocPool = NULL;
 | 
| -    fDrawBufferIBAllocPool = NULL;
 | 
|      fFlushToReduceCacheSize = false;
 | 
|      fAARectRenderer = NULL;
 | 
|      fOvalRenderer = NULL;
 | 
| @@ -131,7 +122,7 @@ void GrContext::initCommon() {
 | 
|  
 | 
|      fDidTestPMConversions = false;
 | 
|  
 | 
| -    this->setupDrawBuffer();
 | 
| +    fDrawBuffer = SkNEW_ARGS(GrInOrderDrawBuffer, (this));
 | 
|  
 | 
|      // GrBatchFontCache will eventually replace GrFontCache
 | 
|      fBatchFontCache = SkNEW_ARGS(GrBatchFontCache, (this));
 | 
| @@ -154,8 +145,6 @@ GrContext::~GrContext() {
 | 
|      SkDELETE(fResourceCache);
 | 
|      SkDELETE(fBatchFontCache);
 | 
|      SkDELETE(fDrawBuffer);
 | 
| -    SkDELETE(fDrawBufferVBAllocPool);
 | 
| -    SkDELETE(fDrawBufferIBAllocPool);
 | 
|  
 | 
|      fAARectRenderer->unref();
 | 
|      fOvalRenderer->unref();
 | 
| @@ -178,15 +167,9 @@ void GrContext::abandonContext() {
 | 
|      SkSafeSetNull(fPathRendererChain);
 | 
|      SkSafeSetNull(fSoftwarePathRenderer);
 | 
|  
 | 
| -    delete fDrawBuffer;
 | 
| +    SkDELETE(fDrawBuffer);
 | 
|      fDrawBuffer = NULL;
 | 
|  
 | 
| -    delete fDrawBufferVBAllocPool;
 | 
| -    fDrawBufferVBAllocPool = NULL;
 | 
| -
 | 
| -    delete fDrawBufferIBAllocPool;
 | 
| -    fDrawBufferIBAllocPool = NULL;
 | 
| -
 | 
|      fBatchFontCache->freeAll();
 | 
|      fLayerCache->freeAll();
 | 
|      fTextBlobCache->freeAll();
 | 
| @@ -474,10 +457,8 @@ public:
 | 
|          const GrVertexBuffer* vertexBuffer;
 | 
|          int firstVertex;
 | 
|  
 | 
| -        void* verts = batchTarget->vertexPool()->makeSpace(vertexStride,
 | 
| -                                                           vertexCount,
 | 
| -                                                           &vertexBuffer,
 | 
| -                                                           &firstVertex);
 | 
| +        void* verts = batchTarget->makeVertSpace(vertexStride, vertexCount,
 | 
| +                                                 &vertexBuffer, &firstVertex);
 | 
|  
 | 
|          if (!verts) {
 | 
|              SkDebugf("Could not allocate vertices\n");
 | 
| @@ -812,10 +793,8 @@ public:
 | 
|          const GrVertexBuffer* vertexBuffer;
 | 
|          int firstVertex;
 | 
|  
 | 
| -        void* verts = batchTarget->vertexPool()->makeSpace(vertexStride,
 | 
| -                                                           this->vertexCount(),
 | 
| -                                                           &vertexBuffer,
 | 
| -                                                              &firstVertex);
 | 
| +        void* verts = batchTarget->makeVertSpace(vertexStride, this->vertexCount(),
 | 
| +                                                 &vertexBuffer, &firstVertex);
 | 
|  
 | 
|          if (!verts) {
 | 
|              SkDebugf("Could not allocate vertices\n");
 | 
| @@ -825,11 +804,9 @@ public:
 | 
|          const GrIndexBuffer* indexBuffer = NULL;
 | 
|          int firstIndex = 0;
 | 
|  
 | 
| -        void* indices = NULL;
 | 
| +        uint16_t* indices = NULL;
 | 
|          if (this->hasIndices()) {
 | 
| -            indices = batchTarget->indexPool()->makeSpace(this->indexCount(),
 | 
| -                                                          &indexBuffer,
 | 
| -                                                          &firstIndex);
 | 
| +            indices = batchTarget->makeIndexSpace(this->indexCount(), &indexBuffer, &firstIndex);
 | 
|  
 | 
|              if (!indices) {
 | 
|                  SkDebugf("Could not allocate indices\n");
 | 
| @@ -845,7 +822,7 @@ public:
 | 
|              // TODO we can actually cache this interleaved and then just memcopy
 | 
|              if (this->hasIndices()) {
 | 
|                  for (int j = 0; j < args.fIndices.count(); ++j, ++indexOffset) {
 | 
| -                    *((uint16_t*)indices + indexOffset) = args.fIndices[j] + vertexOffset;
 | 
| +                    *(indices + indexOffset) = args.fIndices[j] + vertexOffset;
 | 
|                  }
 | 
|              }
 | 
|  
 | 
| @@ -1804,25 +1781,6 @@ int GrContext::getRecommendedSampleCount(GrPixelConfig config,
 | 
|          chosenSampleCount : 0;
 | 
|  }
 | 
|  
 | 
| -void GrContext::setupDrawBuffer() {
 | 
| -    SkASSERT(NULL == fDrawBuffer);
 | 
| -    SkASSERT(NULL == fDrawBufferVBAllocPool);
 | 
| -    SkASSERT(NULL == fDrawBufferIBAllocPool);
 | 
| -
 | 
| -    fDrawBufferVBAllocPool =
 | 
| -        SkNEW_ARGS(GrVertexBufferAllocPool, (fGpu,
 | 
| -                                             DRAW_BUFFER_VBPOOL_BUFFER_SIZE,
 | 
| -                                             DRAW_BUFFER_VBPOOL_PREALLOC_BUFFERS));
 | 
| -    fDrawBufferIBAllocPool =
 | 
| -        SkNEW_ARGS(GrIndexBufferAllocPool, (fGpu,
 | 
| -                                            DRAW_BUFFER_IBPOOL_BUFFER_SIZE,
 | 
| -                                            DRAW_BUFFER_IBPOOL_PREALLOC_BUFFERS));
 | 
| -
 | 
| -    fDrawBuffer = SkNEW_ARGS(GrInOrderDrawBuffer, (this,
 | 
| -                                                   fDrawBufferVBAllocPool,
 | 
| -                                                   fDrawBufferIBAllocPool));
 | 
| -}
 | 
| -
 | 
|  GrDrawTarget* GrContext::getTextTarget() {
 | 
|      return this->prepareToDraw();
 | 
|  }
 | 
| 
 |