Put caps in a struct, move up to GrDrawTarget

Review URL: http://codereview.appspot.com/5088049



git-svn-id: http://skia.googlecode.com/svn/trunk@2314 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrInOrderDrawBuffer.cpp b/gpu/src/GrInOrderDrawBuffer.cpp
index 85af430..9519655 100644
--- a/gpu/src/GrInOrderDrawBuffer.cpp
+++ b/gpu/src/GrInOrderDrawBuffer.cpp
@@ -18,8 +18,7 @@
 GrInOrderDrawBuffer::GrInOrderDrawBuffer(const GrGpu* gpu,
                                          GrVertexBufferAllocPool* vertexPool,
                                          GrIndexBufferAllocPool* indexPool)
-    : fGpu(gpu)
-    , fDraws(&fDrawStorage)
+    : fDraws(&fDrawStorage)
     , fStates(&fStateStorage)
     , fClears(&fClearStorage)
     , fClips(&fClipStorage)
@@ -33,12 +32,12 @@
     , fVertexPool(*vertexPool)
     , fIndexPool(*indexPool)
     , fGeoPoolStateStack(&fGeoStackStorage) {
-    
+
+    fCaps = gpu->getCaps();
+
     GrAssert(NULL != vertexPool);
     GrAssert(NULL != indexPool);
 
-    gpu->ref();
-
     GeometryPoolState& poolState = fGeoPoolStateStack.push_back();
     poolState.fUsedPoolVertexBytes = 0;
     poolState.fUsedPoolIndexBytes = 0;
@@ -53,7 +52,6 @@
 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() {
     this->reset();
     GrSafeUnref(fQuadIndexBuffer);
-    fGpu->unref();
 }
 
 void GrInOrderDrawBuffer::initializeDrawStateAndClip(const GrDrawTarget& target) {
@@ -627,7 +625,7 @@
 }
 
 bool GrInOrderDrawBuffer::willUseHWAALines() const {
-    return fGpu->supportsHWAALines() &&
+    return this->getCaps().fHWAALineSupport &&
            CanUseHWAALines(this->getGeomSrc().fVertexLayout, fCurrDrawState);
 }