Remove ObjBaseRef from the hal struct

Change-Id: Idcac14ecfdd4d06a0f54bf50e3b9657be62e6638
diff --git a/rsFBOCache.cpp b/rsFBOCache.cpp
index c5c64c2..f4a8bc6 100644
--- a/rsFBOCache.cpp
+++ b/rsFBOCache.cpp
@@ -26,11 +26,14 @@
 FBOCache::FBOCache() {
     mDirty = true;
     mHal.state.colorTargetsCount = 1;
-    mHal.state.colorTargets = new ObjectBaseRef<Allocation>[mHal.state.colorTargetsCount];
+    mHal.state.colorTargets = new Allocation*[mHal.state.colorTargetsCount];
+    mColorTargets = new ObjectBaseRef<Allocation>[mHal.state.colorTargetsCount];
+    resetAll(NULL);
 }
 
 FBOCache::~FBOCache() {
     delete[] mHal.state.colorTargets;
+    delete[] mColorTargets;
 }
 
 void FBOCache::init(Context *rsc) {
@@ -52,7 +55,8 @@
             return;
         }
     }
-    mHal.state.colorTargets[slot].set(a);
+    mColorTargets[slot].set(a);
+    mHal.state.colorTargets[slot] = a;
     mDirty = true;
 }
 
@@ -63,15 +67,18 @@
             return;
         }
     }
-    mHal.state.depthTarget.set(a);
+    mDepthTarget.set(a);
+    mHal.state.depthTarget = a;
     mDirty = true;
 }
 
 void FBOCache::resetAll(Context *) {
     for (uint32_t i = 0; i < mHal.state.colorTargetsCount; i ++) {
-        mHal.state.colorTargets[i].set(NULL);
+        mColorTargets[i].set(NULL);
+        mHal.state.colorTargets[i] = NULL;
     }
-    mHal.state.depthTarget.set(NULL);
+    mDepthTarget.set(NULL);
+    mHal.state.depthTarget = NULL;
     mDirty = true;
 }