Replace most usages of utils/Vector.h

Change-Id: I540d1b3523244d6c71fc52d6fb30555271c25644
diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp
index f8debcb..751531e 100644
--- a/libs/hwui/AmbientShadow.cpp
+++ b/libs/hwui/AmbientShadow.cpp
@@ -54,7 +54,6 @@
 
 #include <math.h>
 #include <utils/Log.h>
-#include <utils/Vector.h>
 
 #include "AmbientShadow.h"
 #include "ShadowTessellator.h"
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index c617a4d..049d58b 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -43,12 +43,13 @@
 
 #include <utils/KeyedVector.h>
 #include <utils/Singleton.h>
-#include <utils/Vector.h>
 
 #include <cutils/compiler.h>
 
 #include <SkPath.h>
 
+#include <vector>
+
 namespace android {
 namespace uirenderer {
 
@@ -201,7 +202,7 @@
     std::unique_ptr<TextureVertex[]> mRegionMesh;
 
     mutable Mutex mGarbageLock;
-    Vector<Layer*> mLayerGarbage;
+    std::vector<Layer*> mLayerGarbage;
 
     bool mInitialized;
 
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index e56d2be..9fb1e75 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -69,7 +69,7 @@
         // NOTE: ignore empty bounds special case, since we don't merge across those ops
         mBounds.unionWith(state->mBounds);
         mAllOpsOpaque &= opaqueOverBounds;
-        mOps.add(OpStatePair(op, state));
+        mOps.push_back(OpStatePair(op, state));
     }
 
     bool intersects(const Rect& rect) {
@@ -133,7 +133,7 @@
     inline int count() const { return mOps.size(); }
 
 protected:
-    Vector<OpStatePair> mOps;
+    std::vector<OpStatePair> mOps;
     Rect mBounds; // union of bounds of contained ops
 private:
     bool mAllOpsOpaque;
@@ -418,7 +418,7 @@
             this, op, op->getFlags(), newSaveCount);
 
     storeStateOpBarrier(renderer, op);
-    mSaveStack.push(newSaveCount);
+    mSaveStack.push_back(newSaveCount);
 }
 
 /**
@@ -433,7 +433,7 @@
         // store and replay the save operation, as it may be needed to correctly playback the clip
         DEFER_LOGD("    adding save barrier with new save count %d", newSaveCount);
         storeStateOpBarrier(renderer, op);
-        mSaveStack.push(newSaveCount);
+        mSaveStack.push_back(newSaveCount);
     }
 }
 
@@ -456,11 +456,11 @@
         resetBatchingState();
     }
 
-    if (mSaveStack.isEmpty() || newSaveCount > mSaveStack.top()) {
+    if (mSaveStack.empty() || newSaveCount > mSaveStack.back()) {
         return;
     }
 
-    while (!mSaveStack.isEmpty() && mSaveStack.top() >= newSaveCount) mSaveStack.pop();
+    while (!mSaveStack.empty() && mSaveStack.back() >= newSaveCount) mSaveStack.pop_back();
 
     storeRestoreToCountBarrier(renderer, op, mSaveStack.size() + FLUSH_SAVE_STACK_DEPTH);
 }
@@ -492,7 +492,7 @@
     // the merge path in those cases
     deferInfo.mergeable &= !recordingComplexClip();
     deferInfo.opaqueOverBounds &= !recordingComplexClip()
-            && mSaveStack.isEmpty()
+            && mSaveStack.empty()
             && !state->mRoundRectClipState;
 
     if (CC_LIKELY(mAvoidOverdraw) && mBatches.size() &&
@@ -507,7 +507,7 @@
         // TODO: elegant way to reuse batches?
         DrawBatch* b = new DrawBatch(deferInfo);
         b->add(op, state, deferInfo.opaqueOverBounds);
-        mBatches.add(b);
+        mBatches.push_back(b);
         return;
     }
 
@@ -517,12 +517,12 @@
     // insertion point of a new batch, will hopefully be immediately after similar batch
     // (eventually, should be similar shader)
     int insertBatchIndex = mBatches.size();
-    if (!mBatches.isEmpty()) {
+    if (!mBatches.empty()) {
         if (state->mBounds.isEmpty()) {
             // don't know the bounds for op, so add to last batch and start from scratch on next op
             DrawBatch* b = new DrawBatch(deferInfo);
             b->add(op, state, deferInfo.opaqueOverBounds);
-            mBatches.add(b);
+            mBatches.push_back(b);
             resetBatchingState();
 #if DEBUG_DEFER
             DEFER_LOGD("Warning: Encountered op with empty bounds, resetting batches");
@@ -586,7 +586,7 @@
         DEFER_LOGD("creating %singBatch %p, bid %x, at %d",
                 deferInfo.mergeable ? "Merg" : "Draw",
                 targetBatch, deferInfo.batchId, insertBatchIndex);
-        mBatches.insertAt(targetBatch, insertBatchIndex);
+        mBatches.insert(mBatches.begin() + insertBatchIndex, targetBatch);
     }
 
     targetBatch->add(op, state, deferInfo.opaqueOverBounds);
@@ -597,7 +597,7 @@
 
     DeferredDisplayState* state = createState();
     renderer.storeDisplayState(*state, getStateOpDeferFlags());
-    mBatches.add(new StateOpBatch(op, state));
+    mBatches.push_back(new StateOpBatch(op, state));
     resetBatchingState();
 }
 
@@ -610,7 +610,7 @@
     // doesn't have kClip_SaveFlag set
     DeferredDisplayState* state = createState();
     renderer.storeDisplayState(*state, getStateOpDeferFlags());
-    mBatches.add(new RestoreToCountBatch(op, state, newSaveCount));
+    mBatches.push_back(new RestoreToCountBatch(op, state, newSaveCount));
     resetBatchingState();
 }
 
@@ -618,7 +618,7 @@
 // Replay / flush
 /////////////////////////////////////////////////////////////////////////////////
 
-static void replayBatchList(const Vector<Batch*>& batchList,
+static void replayBatchList(const std::vector<Batch*>& batchList,
         OpenGLRenderer& renderer, Rect& dirty) {
 
     for (unsigned int i = 0; i < batchList.size(); i++) {
@@ -664,7 +664,7 @@
         // leave deferred state ops alone for simplicity (empty save restore pairs may now exist)
         if (mBatches[i] && mBatches[i]->purelyDrawBatch()) {
             delete mBatches[i];
-            mBatches.replaceAt(nullptr, i);
+            mBatches[i] = nullptr;
         }
     }
     mEarliestUnclearedIndex = maxIndex + 1;
diff --git a/libs/hwui/DeferredDisplayList.h b/libs/hwui/DeferredDisplayList.h
index 160c1ad..4f2dca5 100644
--- a/libs/hwui/DeferredDisplayList.h
+++ b/libs/hwui/DeferredDisplayList.h
@@ -19,13 +19,14 @@
 
 #include <utils/Errors.h>
 #include <utils/LinearAllocator.h>
-#include <utils/Vector.h>
 #include <utils/TinyHashMap.h>
 
 #include "Matrix.h"
 #include "OpenGLRenderer.h"
 #include "Rect.h"
 
+#include <vector>
+
 class SkBitmap;
 
 namespace android {
@@ -100,7 +101,7 @@
         kOpBatch_Count, // Add other batch ids before this
     };
 
-    bool isEmpty() { return mBatches.isEmpty(); }
+    bool isEmpty() { return mBatches.empty(); }
 
     /**
      * Plays back all of the draw ops recorded into batches to the renderer.
@@ -157,10 +158,10 @@
      * that when an associated restoreToCount is deferred, it can be recorded as a
      * RestoreToCountBatch
      */
-    Vector<int> mSaveStack;
+    std::vector<int> mSaveStack;
     int mComplexClipStackStart;
 
-    Vector<Batch*> mBatches;
+    std::vector<Batch*> mBatches;
 
     // Maps batch ids to the most recent *non-merging* batch of that id
     Batch* mBatchLookup[kOpBatch_Count];
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp
index eacfac7..0af9420 100644
--- a/libs/hwui/DisplayList.cpp
+++ b/libs/hwui/DisplayList.cpp
@@ -40,13 +40,13 @@
     resourceCache.lock();
 
     for (size_t i = 0; i < patchResources.size(); i++) {
-        resourceCache.decrementRefcountLocked(patchResources.itemAt(i));
+        resourceCache.decrementRefcountLocked(patchResources[i]);
     }
 
     resourceCache.unlock();
 
     for (size_t i = 0; i < pathResources.size(); i++) {
-        const SkPath* path = pathResources.itemAt(i);
+        const SkPath* path = pathResources[i];
         if (path->unique() && Caches::hasInstance()) {
             Caches::getInstance().pathCache.removeDeferred(path);
         }
@@ -60,8 +60,10 @@
 }
 
 size_t DisplayListData::addChild(DrawRenderNodeOp* op) {
-    mReferenceHolders.push(op->renderNode());
-    return mChildren.add(op);
+    mReferenceHolders.push_back(op->renderNode());
+    size_t index = mChildren.size();
+    mChildren.push_back(op);
+    return index;
 }
 
 }; // namespace uirenderer
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index d761548..0bdb816 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -27,7 +27,6 @@
 #include <utils/RefBase.h>
 #include <utils/SortedVector.h>
 #include <utils/String8.h>
-#include <utils/Vector.h>
 
 #include <cutils/compiler.h>
 
@@ -39,6 +38,8 @@
 #include "Matrix.h"
 #include "RenderProperties.h"
 
+#include <vector>
+
 class SkBitmap;
 class SkPaint;
 class SkPath;
@@ -124,28 +125,28 @@
     ~DisplayListData();
 
     // pointers to all ops within display list, pointing into allocator data
-    Vector<DisplayListOp*> displayListOps;
+    std::vector<DisplayListOp*> displayListOps;
 
     // index of DisplayListOp restore, after which projected descendents should be drawn
     int projectionReceiveIndex;
 
-    Vector<const SkBitmap*> bitmapResources;
-    Vector<const SkPath*> pathResources;
-    Vector<const Res_png_9patch*> patchResources;
+    std::vector<const SkBitmap*> bitmapResources;
+    std::vector<const SkPath*> pathResources;
+    std::vector<const Res_png_9patch*> patchResources;
 
     std::vector<std::unique_ptr<const SkPaint>> paints;
     std::vector<std::unique_ptr<const SkRegion>> regions;
     Vector<Functor*> functors;
 
-    const Vector<Chunk>& getChunks() const {
+    const std::vector<Chunk>& getChunks() const {
         return chunks;
     }
 
     size_t addChild(DrawRenderNodeOp* childOp);
-    const Vector<DrawRenderNodeOp*>& children() { return mChildren; }
+    const std::vector<DrawRenderNodeOp*>& children() { return mChildren; }
 
     void ref(VirtualLightRefBase* prop) {
-        mReferenceHolders.push(prop);
+        mReferenceHolders.push_back(prop);
     }
 
     size_t getUsedSize() {
@@ -156,12 +157,12 @@
     }
 
 private:
-    Vector< sp<VirtualLightRefBase> > mReferenceHolders;
+    std::vector< sp<VirtualLightRefBase> > mReferenceHolders;
 
     // list of children display lists for quick, non-drawing traversal
-    Vector<DrawRenderNodeOp*> mChildren;
+    std::vector<DrawRenderNodeOp*> mChildren;
 
-    Vector<Chunk> chunks;
+    std::vector<Chunk> chunks;
 
     // allocator into which all ops were allocated
     LinearAllocator allocator;
diff --git a/libs/hwui/DisplayListCanvas.cpp b/libs/hwui/DisplayListCanvas.cpp
index af18e03..74189aa 100644
--- a/libs/hwui/DisplayListCanvas.cpp
+++ b/libs/hwui/DisplayListCanvas.cpp
@@ -548,11 +548,12 @@
 }
 
 size_t DisplayListCanvas::addOpAndUpdateChunk(DisplayListOp* op) {
-    int insertIndex = mDisplayListData->displayListOps.add(op);
+    int insertIndex = mDisplayListData->displayListOps.size();
+    mDisplayListData->displayListOps.push_back(op);
     if (mDeferredBarrierType != kBarrier_None) {
         // op is first in new chunk
-        mDisplayListData->chunks.push();
-        DisplayListData::Chunk& newChunk = mDisplayListData->chunks.editTop();
+        mDisplayListData->chunks.emplace_back();
+        DisplayListData::Chunk& newChunk = mDisplayListData->chunks.back();
         newChunk.beginOpIndex = insertIndex;
         newChunk.endOpIndex = insertIndex + 1;
         newChunk.reorderChildren = (mDeferredBarrierType == kBarrier_OutOfOrder);
@@ -562,7 +563,7 @@
         mDeferredBarrierType = kBarrier_None;
     } else {
         // standard case - append to existing chunk
-        mDisplayListData->chunks.editTop().endOpIndex = insertIndex + 1;
+        mDisplayListData->chunks.back().endOpIndex = insertIndex + 1;
     }
     return insertIndex;
 }
@@ -594,7 +595,7 @@
     int childIndex = mDisplayListData->addChild(op);
 
     // update the chunk's child indices
-    DisplayListData::Chunk& chunk = mDisplayListData->chunks.editTop();
+    DisplayListData::Chunk& chunk = mDisplayListData->chunks.back();
     chunk.endChildIndex = childIndex + 1;
 
     if (op->renderNode()->stagingProperties().isProjectionReceiver()) {
diff --git a/libs/hwui/DisplayListCanvas.h b/libs/hwui/DisplayListCanvas.h
index 6f2e2b5..28954d1 100644
--- a/libs/hwui/DisplayListCanvas.h
+++ b/libs/hwui/DisplayListCanvas.h
@@ -270,7 +270,7 @@
         // The points/verbs within the path are refcounted so this copy operation
         // is inexpensive and maintains the generationID of the original path.
         const SkPath* cachedPath = new SkPath(*path);
-        mDisplayListData->pathResources.add(cachedPath);
+        mDisplayListData->pathResources.push_back(cachedPath);
         return cachedPath;
     }
 
@@ -345,7 +345,7 @@
     }
 
     inline const Res_png_9patch* refPatch(const Res_png_9patch* patch) {
-        mDisplayListData->patchResources.add(patch);
+        mDisplayListData->patchResources.push_back(patch);
         mResourceCache.incrementRefcount(patch);
         return patch;
     }
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 8b4b4ba..8ff58d4 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -139,7 +139,7 @@
      * reducing which operations are tagged as mergeable.
      */
     virtual void multiDraw(OpenGLRenderer& renderer, Rect& dirty,
-            const Vector<OpStatePair>& ops, const Rect& bounds) {
+            const std::vector<OpStatePair>& ops, const Rect& bounds) {
         for (unsigned int i = 0; i < ops.size(); i++) {
             renderer.restoreDisplayState(*(ops[i].state), true);
             ops[i].op->applyDraw(renderer, dirty);
@@ -648,7 +648,7 @@
      * the current layer, if any.
      */
     virtual void multiDraw(OpenGLRenderer& renderer, Rect& dirty,
-            const Vector<OpStatePair>& ops, const Rect& bounds) override {
+            const std::vector<OpStatePair>& ops, const Rect& bounds) override {
         const DeferredDisplayState& firstState = *(ops[0].state);
         renderer.restoreDisplayState(firstState, true); // restore all but the clip
 
@@ -819,7 +819,7 @@
      * is also responsible for dirtying the current layer, if any.
      */
     virtual void multiDraw(OpenGLRenderer& renderer, Rect& dirty,
-            const Vector<OpStatePair>& ops, const Rect& bounds) override {
+            const std::vector<OpStatePair>& ops, const Rect& bounds) override {
         const DeferredDisplayState& firstState = *(ops[0].state);
         renderer.restoreDisplayState(firstState, true); // restore all but the clip
 
@@ -1358,7 +1358,7 @@
     }
 
     virtual void multiDraw(OpenGLRenderer& renderer, Rect& dirty,
-            const Vector<OpStatePair>& ops, const Rect& bounds) override {
+            const std::vector<OpStatePair>& ops, const Rect& bounds) override {
         for (unsigned int i = 0; i < ops.size(); i++) {
             const DeferredDisplayState& state = *(ops[i].state);
             DrawOpMode drawOpMode = (i == ops.size() - 1) ? DrawOpMode::kFlush : DrawOpMode::kDefer;
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 9c2c119..9be8c7d 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -134,7 +134,7 @@
     sLogFontRendererCreate = false;
 }
 
-void clearCacheTextures(Vector<CacheTexture*>& cacheTextures) {
+void clearCacheTextures(std::vector<CacheTexture*>& cacheTextures) {
     for (uint32_t i = 0; i < cacheTextures.size(); i++) {
         delete cacheTextures[i];
     }
@@ -171,7 +171,7 @@
     mDrawn = false;
 }
 
-void FontRenderer::flushLargeCaches(Vector<CacheTexture*>& cacheTextures) {
+void FontRenderer::flushLargeCaches(std::vector<CacheTexture*>& cacheTextures) {
     // Start from 1; don't deallocate smallest/default texture
     for (uint32_t i = 1; i < cacheTextures.size(); i++) {
         CacheTexture* cacheTexture = cacheTextures[i];
@@ -191,7 +191,7 @@
     flushLargeCaches(mRGBACacheTextures);
 }
 
-CacheTexture* FontRenderer::cacheBitmapInTexture(Vector<CacheTexture*>& cacheTextures,
+CacheTexture* FontRenderer::cacheBitmapInTexture(std::vector<CacheTexture*>& cacheTextures,
         const SkGlyph& glyph, uint32_t* startX, uint32_t* startY) {
     for (uint32_t i = 0; i < cacheTextures.size(); i++) {
         if (cacheTextures[i]->fitBitmap(glyph, startX, startY)) {
@@ -218,7 +218,7 @@
 
     // choose an appropriate cache texture list for this glyph format
     SkMask::Format format = static_cast<SkMask::Format>(glyph.fMaskFormat);
-    Vector<CacheTexture*>* cacheTextures = nullptr;
+    std::vector<CacheTexture*>* cacheTextures = nullptr;
     switch (format) {
         case SkMask::kA8_Format:
         case SkMask::kBW_Format:
@@ -399,17 +399,17 @@
     clearCacheTextures(mRGBACacheTextures);
 
     mUploadTexture = false;
-    mACacheTextures.push(createCacheTexture(mSmallCacheWidth, mSmallCacheHeight,
+    mACacheTextures.push_back(createCacheTexture(mSmallCacheWidth, mSmallCacheHeight,
             GL_ALPHA, true));
-    mACacheTextures.push(createCacheTexture(mLargeCacheWidth, mLargeCacheHeight >> 1,
+    mACacheTextures.push_back(createCacheTexture(mLargeCacheWidth, mLargeCacheHeight >> 1,
             GL_ALPHA, false));
-    mACacheTextures.push(createCacheTexture(mLargeCacheWidth, mLargeCacheHeight >> 1,
+    mACacheTextures.push_back(createCacheTexture(mLargeCacheWidth, mLargeCacheHeight >> 1,
             GL_ALPHA, false));
-    mACacheTextures.push(createCacheTexture(mLargeCacheWidth, mLargeCacheHeight,
+    mACacheTextures.push_back(createCacheTexture(mLargeCacheWidth, mLargeCacheHeight,
             GL_ALPHA, false));
-    mRGBACacheTextures.push(createCacheTexture(mSmallCacheWidth, mSmallCacheHeight,
+    mRGBACacheTextures.push_back(createCacheTexture(mSmallCacheWidth, mSmallCacheHeight,
             GL_RGBA, false));
-    mRGBACacheTextures.push(createCacheTexture(mLargeCacheWidth, mLargeCacheHeight >> 1,
+    mRGBACacheTextures.push_back(createCacheTexture(mLargeCacheWidth, mLargeCacheHeight >> 1,
             GL_RGBA, false));
     mCurrentCacheTexture = mACacheTextures[0];
 }
@@ -425,7 +425,7 @@
     mInitialized = true;
 }
 
-void checkTextureUpdateForCache(Caches& caches, Vector<CacheTexture*>& cacheTextures,
+void checkTextureUpdateForCache(Caches& caches, std::vector<CacheTexture*>& cacheTextures,
         bool& resetPixelStore, GLuint& lastTextureId) {
     for (uint32_t i = 0; i < cacheTextures.size(); i++) {
         CacheTexture* cacheTexture = cacheTextures[i];
@@ -470,7 +470,7 @@
     mUploadTexture = false;
 }
 
-void FontRenderer::issueDrawCommand(Vector<CacheTexture*>& cacheTextures) {
+void FontRenderer::issueDrawCommand(std::vector<CacheTexture*>& cacheTextures) {
     if (!mFunctor) return;
 
     bool first = true;
@@ -739,7 +739,7 @@
     Blur::vertical(gaussian.get(), intRadius, scratch.get(), *image, width, height);
 }
 
-static uint32_t calculateCacheSize(const Vector<CacheTexture*>& cacheTextures) {
+static uint32_t calculateCacheSize(const std::vector<CacheTexture*>& cacheTextures) {
     uint32_t size = 0;
     for (uint32_t i = 0; i < cacheTextures.size(); i++) {
         CacheTexture* cacheTexture = cacheTextures[i];
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index dfb107c..2954975 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -21,16 +21,16 @@
 #include "font/CacheTexture.h"
 #include "font/CachedGlyphInfo.h"
 #include "font/Font.h"
-#include "utils/SortedList.h"
 
 #include <utils/LruCache.h>
-#include <utils/Vector.h>
 #include <utils/StrongPointer.h>
 
 #include <SkPaint.h>
 
 #include <GLES2/gl2.h>
 
+#include <vector>
+
 #ifdef ANDROID_ENABLE_RENDERSCRIPT
 #include "RenderScript.h"
 namespace RSC {
@@ -75,7 +75,7 @@
     FontRenderer();
     ~FontRenderer();
 
-    void flushLargeCaches(Vector<CacheTexture*>& cacheTextures);
+    void flushLargeCaches(std::vector<CacheTexture*>& cacheTextures);
     void flushLargeCaches();
 
     void setGammaTable(const uint8_t* gammaTable) {
@@ -127,7 +127,7 @@
     CacheTexture* createCacheTexture(int width, int height, GLenum format, bool allocate);
     void cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyph,
             uint32_t *retOriginX, uint32_t *retOriginY, bool precaching);
-    CacheTexture* cacheBitmapInTexture(Vector<CacheTexture*>& cacheTextures, const SkGlyph& glyph,
+    CacheTexture* cacheBitmapInTexture(std::vector<CacheTexture*>& cacheTextures, const SkGlyph& glyph,
             uint32_t* startX, uint32_t* startY);
 
     void flushAllAndInvalidate();
@@ -136,7 +136,7 @@
     void initRender(const Rect* clip, Rect* bounds, TextDrawFunctor* functor);
     void finishRender();
 
-    void issueDrawCommand(Vector<CacheTexture*>& cacheTextures);
+    void issueDrawCommand(std::vector<CacheTexture*>& cacheTextures);
     void issueDrawCommand();
     void appendMeshQuadNoClip(float x1, float y1, float u1, float v1,
             float x2, float y2, float u2, float v2,
@@ -164,8 +164,8 @@
     uint32_t mLargeCacheWidth;
     uint32_t mLargeCacheHeight;
 
-    Vector<CacheTexture*> mACacheTextures;
-    Vector<CacheTexture*> mRGBACacheTextures;
+    std::vector<CacheTexture*> mACacheTextures;
+    std::vector<CacheTexture*> mRGBACacheTextures;
 
     Font* mCurrentFont;
     LruCache<Font::FontDescription, Font*> mActiveFonts;
diff --git a/libs/hwui/GradientCache.h b/libs/hwui/GradientCache.h
index 08319ea..7534c5d 100644
--- a/libs/hwui/GradientCache.h
+++ b/libs/hwui/GradientCache.h
@@ -25,7 +25,6 @@
 
 #include <utils/LruCache.h>
 #include <utils/Mutex.h>
-#include <utils/Vector.h>
 
 namespace android {
 namespace uirenderer {
@@ -183,7 +182,6 @@
     bool mUseFloatTexture;
     bool mHasNpot;
 
-    Vector<SkShader*> mGarbage;
     mutable Mutex mLock;
 }; // class GradientCache
 
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index c260f5f..8e04bdf 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -419,7 +419,7 @@
 
         // Note: it is very important to update the layers in order
         for (int i = 0; i < count; i++) {
-            Layer* layer = mLayerUpdates.itemAt(i).get();
+            Layer* layer = mLayerUpdates[i].get();
             updateLayer(layer, false);
         }
 
@@ -438,7 +438,7 @@
 
         // Note: it is very important to update the layers in order
         for (int i = 0; i < count; i++) {
-            mLayerUpdates.itemAt(i)->flush();
+            mLayerUpdates[i]->flush();
         }
 
         mLayerUpdates.clear();
@@ -455,7 +455,7 @@
         // the insertion order. The linear search is not an issue since
         // this list is usually very short (typically one item, at most a few)
         for (int i = mLayerUpdates.size() - 1; i >= 0; i--) {
-            if (mLayerUpdates.itemAt(i) == layer) {
+            if (mLayerUpdates[i] == layer) {
                 return;
             }
         }
@@ -466,8 +466,8 @@
 void OpenGLRenderer::cancelLayerUpdate(Layer* layer) {
     if (layer) {
         for (int i = mLayerUpdates.size() - 1; i >= 0; i--) {
-            if (mLayerUpdates.itemAt(i) == layer) {
-                mLayerUpdates.removeAt(i);
+            if (mLayerUpdates[i] == layer) {
+                mLayerUpdates.erase(mLayerUpdates.begin() + i);
                 break;
             }
         }
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 402f6ed..390f620 100755
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -44,12 +44,13 @@
 #include <utils/Functor.h>
 #include <utils/RefBase.h>
 #include <utils/SortedVector.h>
-#include <utils/Vector.h>
 
 #include <cutils/compiler.h>
 
 #include <androidfw/ResourceTypes.h>
 
+#include <vector>
+
 class SkShader;
 
 namespace android {
@@ -855,7 +856,7 @@
     // List of rectangles to clear after saveLayer() is invoked
     std::vector<Rect> mLayers;
     // List of layers to update at the beginning of a frame
-    Vector< sp<Layer> > mLayerUpdates;
+    std::vector< sp<Layer> > mLayerUpdates;
 
     // See PROPERTY_DISABLE_SCISSOR_OPTIMIZATION in
     // Properties.h
diff --git a/libs/hwui/Patch.cpp b/libs/hwui/Patch.cpp
index 15d2ae9..500f9e9 100644
--- a/libs/hwui/Patch.cpp
+++ b/libs/hwui/Patch.cpp
@@ -206,8 +206,7 @@
 
     // Record all non empty quads
     if (hasEmptyQuads) {
-        Rect bounds(x1, y1, x2, y2);
-        quads.add(bounds);
+        quads.emplace_back(x1, y1, x2, y2);
     }
 
     mUvMapper.map(u1, v1, u2, v2);
diff --git a/libs/hwui/Patch.h b/libs/hwui/Patch.h
index b63bd24..f04416c 100644
--- a/libs/hwui/Patch.h
+++ b/libs/hwui/Patch.h
@@ -21,13 +21,13 @@
 
 #include <GLES2/gl2.h>
 
-#include <utils/Vector.h>
-
 #include <androidfw/ResourceTypes.h>
 
 #include "Rect.h"
 #include "UvMapper.h"
 
+#include <vector>
+
 namespace android {
 namespace uirenderer {
 
@@ -52,7 +52,7 @@
     uint32_t verticesCount = 0;
     uint32_t indexCount = 0;
     bool hasEmptyQuads = false;
-    Vector<Rect> quads;
+    std::vector<Rect> quads;
 
     GLintptr positionOffset = 0;
     GLintptr textureOffset = 0;
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index e36f5f1..f503e5d 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -338,7 +338,7 @@
 
 void PathCache::removeDeferred(const SkPath* path) {
     Mutex::Autolock l(mLock);
-    mGarbage.push(path->getGenerationID());
+    mGarbage.push_back(path->getGenerationID());
 }
 
 void PathCache::clearGarbage() {
@@ -346,10 +346,7 @@
 
     { // scope for the mutex
         Mutex::Autolock l(mLock);
-        size_t count = mGarbage.size();
-        for (size_t i = 0; i < count; i++) {
-            const uint32_t generationID = mGarbage.itemAt(i);
-
+        for (const uint32_t generationID : mGarbage) {
             LruCache<PathDescription, PathTexture*>::Iterator iter(mCache);
             while (iter.next()) {
                 const PathDescription& key = iter.key();
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index 7014863..31f8d35 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -28,7 +28,8 @@
 #include <SkPath.h>
 #include <utils/LruCache.h>
 #include <utils/Mutex.h>
-#include <utils/Vector.h>
+
+#include <vector>
 
 class SkBitmap;
 class SkCanvas;
@@ -307,7 +308,7 @@
 
     sp<PathProcessor> mProcessor;
 
-    Vector<uint32_t> mGarbage;
+    std::vector<uint32_t> mGarbage;
     mutable Mutex mLock;
 }; // class PathCache
 
diff --git a/libs/hwui/PathTessellator.cpp b/libs/hwui/PathTessellator.cpp
index 5294be8..8fa187c 100644
--- a/libs/hwui/PathTessellator.cpp
+++ b/libs/hwui/PathTessellator.cpp
@@ -177,7 +177,8 @@
     }
 };
 
-void getFillVerticesFromPerimeter(const Vector<Vertex>& perimeter, VertexBuffer& vertexBuffer) {
+void getFillVerticesFromPerimeter(const std::vector<Vertex>& perimeter,
+        VertexBuffer& vertexBuffer) {
     Vertex* buffer = vertexBuffer.alloc<Vertex>(perimeter.size());
 
     int currentIndex = 0;
@@ -201,8 +202,8 @@
  * Uses an additional 2 vertices at the end to wrap around, closing the tri-strip
  * (for a total of perimeter.size() * 2 + 2 vertices)
  */
-void getStrokeVerticesFromPerimeter(const PaintInfo& paintInfo, const Vector<Vertex>& perimeter,
-        VertexBuffer& vertexBuffer) {
+void getStrokeVerticesFromPerimeter(const PaintInfo& paintInfo,
+        const std::vector<Vertex>& perimeter, VertexBuffer& vertexBuffer) {
     Vertex* buffer = vertexBuffer.alloc<Vertex>(perimeter.size() * 2 + 2);
 
     int currentIndex = 0;
@@ -260,7 +261,7 @@
  * 2 - can zig-zag across 'extra' vertices at either end, to create round caps
  */
 void getStrokeVerticesFromUnclosedVertices(const PaintInfo& paintInfo,
-        const Vector<Vertex>& vertices, VertexBuffer& vertexBuffer) {
+        const std::vector<Vertex>& vertices, VertexBuffer& vertexBuffer) {
     const int extra = paintInfo.capExtraDivisions();
     const int allocSize = (vertices.size() + extra) * 2;
     Vertex* buffer = vertexBuffer.alloc<Vertex>(allocSize);
@@ -339,8 +340,9 @@
  *
  * 3 - zig zag back and forth inside the shape to fill it (using perimeter.size() vertices)
  */
-void getFillVerticesFromPerimeterAA(const PaintInfo& paintInfo, const Vector<Vertex>& perimeter,
-        VertexBuffer& vertexBuffer, float maxAlpha = 1.0f) {
+void getFillVerticesFromPerimeterAA(const PaintInfo& paintInfo,
+        const std::vector<Vertex>& perimeter, VertexBuffer& vertexBuffer,
+        float maxAlpha = 1.0f) {
     AlphaVertex* buffer = vertexBuffer.alloc<AlphaVertex>(perimeter.size() * 3 + 2);
 
     // generate alpha points - fill Alpha vertex gaps in between each point with
@@ -398,7 +400,7 @@
  * For explanation of constants and general methodoloyg, see comments for
  * getStrokeVerticesFromUnclosedVerticesAA() below.
  */
-inline static void storeCapAA(const PaintInfo& paintInfo, const Vector<Vertex>& vertices,
+inline static void storeCapAA(const PaintInfo& paintInfo, const std::vector<Vertex>& vertices,
         AlphaVertex* buffer, bool isFirst, Vector2 normal, int offset) {
     const int extra = paintInfo.capExtraDivisions();
     const int extraOffset = (extra + 1) / 2;
@@ -423,8 +425,8 @@
     }
 
     // determine referencePoint, the center point for the 4 primary cap vertices
-    const Vertex* point = isFirst ? vertices.begin() : (vertices.end() - 1);
-    Vector2 referencePoint = {point->x, point->y};
+    const Vertex& point = isFirst ? vertices.front() : vertices.back();
+    Vector2 referencePoint = {point.x, point.y};
     if (paintInfo.cap == SkPaint::kSquare_Cap) {
         // To account for square cap, move the primary cap vertices (that create the AA edge) by the
         // stroke offset vector (rotated to be parallel to the stroke)
@@ -569,7 +571,7 @@
     = 2 + 6 * pts + 6 * roundDivs
  */
 void getStrokeVerticesFromUnclosedVerticesAA(const PaintInfo& paintInfo,
-        const Vector<Vertex>& vertices, VertexBuffer& vertexBuffer) {
+        const std::vector<Vertex>& vertices, VertexBuffer& vertexBuffer) {
 
     const int extra = paintInfo.capExtraDivisions();
     const int allocSize = 6 * vertices.size() + 2 + 6 * extra;
@@ -642,8 +644,8 @@
 }
 
 
-void getStrokeVerticesFromPerimeterAA(const PaintInfo& paintInfo, const Vector<Vertex>& perimeter,
-        VertexBuffer& vertexBuffer) {
+void getStrokeVerticesFromPerimeterAA(const PaintInfo& paintInfo,
+        const std::vector<Vertex>& perimeter, VertexBuffer& vertexBuffer) {
     AlphaVertex* buffer = vertexBuffer.alloc<AlphaVertex>(6 * perimeter.size() + 8);
 
     int offset = 2 * perimeter.size() + 3;
@@ -721,7 +723,7 @@
 
     const PaintInfo paintInfo(paint, transform);
 
-    Vector<Vertex> tempVertices;
+    std::vector<Vertex> tempVertices;
     float threshInvScaleX = paintInfo.inverseScaleX;
     float threshInvScaleY = paintInfo.inverseScaleY;
     if (paintInfo.style == SkPaint::kStroke_Style) {
@@ -816,7 +818,7 @@
     }
 
     // calculate outline
-    Vector<Vertex> outlineVertices;
+    std::vector<Vertex> outlineVertices;
     PathApproximationInfo approximationInfo(paintInfo.inverseScaleX, paintInfo.inverseScaleY,
             OUTLINE_REFINE_THRESHOLD);
     approximatePathOutlineVertices(path, true, approximationInfo, outlineVertices);
@@ -858,10 +860,8 @@
         vertexBuffer.alloc<Vertex>(numLines * lineAllocSize + (numLines - 1) * 2);
     }
 
-    Vector<Vertex> tempVertices;
-    tempVertices.push();
-    tempVertices.push();
-    Vertex* tempVerticesData = tempVertices.editArray();
+    std::vector<Vertex> tempVertices(2);
+    Vertex* tempVerticesData = &tempVertices.front();
     Rect bounds;
     bounds.set(points[0], points[1], points[0], points[1]);
     for (int i = 0; i < count; i += 4) {
@@ -897,18 +897,11 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 bool PathTessellator::approximatePathOutlineVertices(const SkPath& path, float threshold,
-        Vector<Vertex>& outputVertices) {
+        std::vector<Vertex>& outputVertices) {
     PathApproximationInfo approximationInfo(1.0f, 1.0f, threshold);
     return approximatePathOutlineVertices(path, true, approximationInfo, outputVertices);
 }
 
-void pushToVector(Vector<Vertex>& vertices, float x, float y) {
-    // TODO: make this not yuck
-    vertices.push();
-    Vertex* newVertex = &(vertices.editArray()[vertices.size() - 1]);
-    Vertex::set(newVertex, x, y);
-}
-
 class ClockwiseEnforcer {
 public:
     void addPoint(const SkPoint& point) {
@@ -924,15 +917,15 @@
         lastX = x;
         lastY = y;
     }
-    void reverseVectorIfNotClockwise(Vector<Vertex>& vertices) {
+    void reverseVectorIfNotClockwise(std::vector<Vertex>& vertices) {
         if (sum < 0) {
             // negative sum implies CounterClockwise
             const int size = vertices.size();
             for (int i = 0; i < size / 2; i++) {
                 Vertex tmp = vertices[i];
                 int k = size - 1 - i;
-                vertices.replaceAt(vertices[k], i);
-                vertices.replaceAt(tmp, k);
+                vertices[i] = vertices[k];
+                vertices[k] = tmp;
             }
         }
     }
@@ -944,7 +937,7 @@
 };
 
 bool PathTessellator::approximatePathOutlineVertices(const SkPath& path, bool forceClose,
-        const PathApproximationInfo& approximationInfo, Vector<Vertex>& outputVertices) {
+        const PathApproximationInfo& approximationInfo, std::vector<Vertex>& outputVertices) {
     ATRACE_CALL();
 
     // TODO: to support joins other than sharp miter, join vertices should be labelled in the
@@ -956,7 +949,7 @@
     while (SkPath::kDone_Verb != (v = iter.next(pts))) {
             switch (v) {
             case SkPath::kMove_Verb:
-                pushToVector(outputVertices, pts[0].x(), pts[0].y());
+                outputVertices.push_back(Vertex{pts[0].x(), pts[0].y()});
                 ALOGV("Move to pos %f %f", pts[0].x(), pts[0].y());
                 clockwiseEnforcer.addPoint(pts[0]);
                 break;
@@ -966,7 +959,7 @@
                 break;
             case SkPath::kLine_Verb:
                 ALOGV("kLine_Verb %f %f -> %f %f", pts[0].x(), pts[0].y(), pts[1].x(), pts[1].y());
-                pushToVector(outputVertices, pts[1].x(), pts[1].y());
+                outputVertices.push_back(Vertex{pts[1].x(), pts[1].y()});
                 clockwiseEnforcer.addPoint(pts[1]);
                 break;
             case SkPath::kQuad_Verb:
@@ -1017,7 +1010,7 @@
     int size = outputVertices.size();
     if (size >= 2 && outputVertices[0].x == outputVertices[size - 1].x &&
             outputVertices[0].y == outputVertices[size - 1].y) {
-        outputVertices.pop();
+        outputVertices.pop_back();
         wasClosed = true;
     }
 
@@ -1045,7 +1038,7 @@
         float p1x, float p1y, float c1x, float c1y,
         float p2x, float p2y, float c2x, float c2y,
         const PathApproximationInfo& approximationInfo,
-        Vector<Vertex>& outputVertices, int depth) {
+        std::vector<Vertex>& outputVertices, int depth) {
     float dx = p2x - p1x;
     float dy = p2y - p1y;
     float d1 = fabs((c1x - p2x) * dy - (c1y - p2y) * dx);
@@ -1055,7 +1048,7 @@
     if (depth >= MAX_DEPTH
             || d * d <= getThreshold(approximationInfo, dx, dy)) {
         // below thresh, draw line by adding endpoint
-        pushToVector(outputVertices, p2x, p2y);
+        outputVertices.push_back(Vertex{p2x, p2y});
     } else {
         float p1c1x = (p1x + c1x) * 0.5f;
         float p1c1y = (p1y + c1y) * 0.5f;
@@ -1090,7 +1083,7 @@
         float bx, float by,
         float cx, float cy,
         const PathApproximationInfo& approximationInfo,
-        Vector<Vertex>& outputVertices, int depth) {
+        std::vector<Vertex>& outputVertices, int depth) {
     float dx = bx - ax;
     float dy = by - ay;
     // d is the cross product of vector (B-A) and (C-B).
@@ -1099,7 +1092,7 @@
     if (depth >= MAX_DEPTH
             || d * d <= getThreshold(approximationInfo, dx, dy)) {
         // below thresh, draw line by adding endpoint
-        pushToVector(outputVertices, bx, by);
+        outputVertices.push_back(Vertex{bx, by});
     } else {
         float acx = (ax + cx) * 0.5f;
         float bcx = (bx + cx) * 0.5f;
diff --git a/libs/hwui/PathTessellator.h b/libs/hwui/PathTessellator.h
index 16c8b36..b66e832 100644
--- a/libs/hwui/PathTessellator.h
+++ b/libs/hwui/PathTessellator.h
@@ -17,13 +17,13 @@
 #ifndef ANDROID_HWUI_PATH_TESSELLATOR_H
 #define ANDROID_HWUI_PATH_TESSELLATOR_H
 
-#include <utils/Vector.h>
-
 #include "Matrix.h"
 #include "Rect.h"
 #include "Vertex.h"
 #include "VertexBuffer.h"
 
+#include <vector>
+
 namespace android {
 namespace uirenderer {
 
@@ -109,11 +109,11 @@
      * @param outputVertices An empty Vector which will be populated with the output
      */
     static bool approximatePathOutlineVertices(const SkPath &path, float threshold,
-            Vector<Vertex> &outputVertices);
+            std::vector<Vertex> &outputVertices);
 
 private:
     static bool approximatePathOutlineVertices(const SkPath &path, bool forceClose,
-            const PathApproximationInfo& approximationInfo, Vector<Vertex> &outputVertices);
+            const PathApproximationInfo& approximationInfo, std::vector<Vertex> &outputVertices);
 
 /*
   endpoints a & b,
@@ -124,7 +124,7 @@
             float bx, float by,
             float cx, float cy,
             const PathApproximationInfo& approximationInfo,
-            Vector<Vertex> &outputVertices, int depth = 0);
+            std::vector<Vertex> &outputVertices, int depth = 0);
 
 /*
   endpoints p1, p2
@@ -136,7 +136,7 @@
             float p2x, float p2y,
             float c2x, float c2y,
             const PathApproximationInfo& approximationInfo,
-            Vector<Vertex> &outputVertices, int depth = 0);
+            std::vector<Vertex> &outputVertices, int depth = 0);
 };
 
 }; // namespace uirenderer
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 5aef2a5..1a70d7c 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -36,9 +36,6 @@
 // If turned on, text is interpreted as glyphs instead of UTF-16
 #define RENDER_TEXT_AS_GLYPHS 1
 
-// Indicates whether to remove the biggest layers first, or the smaller ones
-#define LAYER_REMOVE_BIGGEST_FIRST 0
-
 // Textures used by layers must have dimensions multiples of this number
 #define LAYER_SIZE 64
 
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 3717aec..af8aaa20 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -528,7 +528,7 @@
 void RenderNode::computeOrderingImpl(
         DrawRenderNodeOp* opState,
         const SkPath* outlineOfProjectionSurface,
-        Vector<DrawRenderNodeOp*>* compositedChildrenOfProjectionSurface,
+        std::vector<DrawRenderNodeOp*>* compositedChildrenOfProjectionSurface,
         const mat4* transformFromProjectionSurface) {
     mProjectedNodes.clear();
     if (mDisplayListData == nullptr || mDisplayListData->isEmpty()) return;
@@ -542,7 +542,7 @@
         // composited projectee, flag for out of order draw, save matrix, and store in proj surface
         opState->mSkipInOrderDraw = true;
         opState->mTransformFromCompositingAncestor.load(localTransformFromProjectionSurface);
-        compositedChildrenOfProjectionSurface->add(opState);
+        compositedChildrenOfProjectionSurface->push_back(opState);
     } else {
         // standard in order draw
         opState->mSkipInOrderDraw = false;
@@ -556,7 +556,7 @@
             RenderNode* child = childOp->mRenderNode;
 
             const SkPath* projectionOutline = nullptr;
-            Vector<DrawRenderNodeOp*>* projectionChildren = nullptr;
+            std::vector<DrawRenderNodeOp*>* projectionChildren = nullptr;
             const mat4* projectionTransform = nullptr;
             if (isProjectionReceiver && !child->properties().getProjectBackwards()) {
                 // if receiving projections, collect projecting descendant
@@ -638,7 +638,7 @@
 }
 
 void RenderNode::buildZSortedChildList(const DisplayListData::Chunk& chunk,
-        Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes) {
+        std::vector<ZDrawRenderNodeOpPair>& zTranslatedNodes) {
     if (chunk.beginChildIndex == chunk.endChildIndex) return;
 
     for (unsigned int i = chunk.beginChildIndex; i < chunk.endChildIndex; i++) {
@@ -647,7 +647,7 @@
         float childZ = child->properties().getZ();
 
         if (!MathUtils::isZero(childZ) && chunk.reorderChildren) {
-            zTranslatedNodes.add(ZDrawRenderNodeOpPair(childZ, childOp));
+            zTranslatedNodes.push_back(ZDrawRenderNodeOpPair(childZ, childOp));
             childOp->mSkipInOrderDraw = true;
         } else if (!child->properties().getProjectBackwards()) {
             // regular, in order drawing DisplayList
@@ -719,7 +719,7 @@
 
 template <class T>
 void RenderNode::issueOperationsOf3dChildren(ChildrenSelectMode mode,
-        const Matrix4& initialTransform, const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
+        const Matrix4& initialTransform, const std::vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
         OpenGLRenderer& renderer, T& handler) {
     const int size = zTranslatedNodes.size();
     if (size == 0
@@ -896,7 +896,7 @@
             for (size_t chunkIndex = 0; chunkIndex < mDisplayListData->getChunks().size(); chunkIndex++) {
                 const DisplayListData::Chunk& chunk = mDisplayListData->getChunks()[chunkIndex];
 
-                Vector<ZDrawRenderNodeOpPair> zTranslatedNodes;
+                std::vector<ZDrawRenderNodeOpPair> zTranslatedNodes;
                 buildZSortedChildList(chunk, zTranslatedNodes);
 
                 issueOperationsOf3dChildren(kNegativeZChildren,
@@ -910,7 +910,7 @@
 #endif
                     handler(op, saveCountOffset, properties().getClipToBounds());
 
-                    if (CC_UNLIKELY(!mProjectedNodes.isEmpty() && projectionReceiveIndex >= 0 &&
+                    if (CC_UNLIKELY(!mProjectedNodes.empty() && projectionReceiveIndex >= 0 &&
                         opIndex == static_cast<size_t>(projectionReceiveIndex))) {
                         issueOperationsOfProjectedChildren(renderer, handler);
                     }
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index 4063d4b..db72287 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -22,7 +22,6 @@
 #include <utils/LinearAllocator.h>
 #include <utils/RefBase.h>
 #include <utils/String8.h>
-#include <utils/Vector.h>
 
 #include <cutils/compiler.h>
 
@@ -34,6 +33,8 @@
 #include "DisplayList.h"
 #include "RenderProperties.h"
 
+#include <vector>
+
 class SkBitmap;
 class SkPaint;
 class SkPath;
@@ -176,7 +177,7 @@
 private:
     typedef key_value_pair_t<float, DrawRenderNodeOp*> ZDrawRenderNodeOpPair;
 
-    static size_t findNonNegativeIndex(const Vector<ZDrawRenderNodeOpPair>& nodes) {
+    static size_t findNonNegativeIndex(const std::vector<ZDrawRenderNodeOpPair>& nodes) {
         for (size_t i = 0; i < nodes.size(); i++) {
             if (nodes[i].key >= 0.0f) return i;
         }
@@ -190,21 +191,21 @@
 
     void computeOrderingImpl(DrawRenderNodeOp* opState,
             const SkPath* outlineOfProjectionSurface,
-            Vector<DrawRenderNodeOp*>* compositedChildrenOfProjectionSurface,
+            std::vector<DrawRenderNodeOp*>* compositedChildrenOfProjectionSurface,
             const mat4* transformFromProjectionSurface);
 
     template <class T>
     inline void setViewProperties(OpenGLRenderer& renderer, T& handler);
 
     void buildZSortedChildList(const DisplayListData::Chunk& chunk,
-            Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes);
+            std::vector<ZDrawRenderNodeOpPair>& zTranslatedNodes);
 
     template<class T>
     inline void issueDrawShadowOperation(const Matrix4& transformFromParent, T& handler);
 
     template <class T>
     inline void issueOperationsOf3dChildren(ChildrenSelectMode mode,
-            const Matrix4& initialTransform, const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
+            const Matrix4& initialTransform, const std::vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
             OpenGLRenderer& renderer, T& handler);
 
     template <class T>
@@ -267,7 +268,7 @@
      */
 
     // for projection surfaces, contains a list of all children items
-    Vector<DrawRenderNodeOp*> mProjectedNodes;
+    std::vector<DrawRenderNodeOp*> mProjectedNodes;
 
     // How many references our parent(s) have to us. Typically this should alternate
     // between 2 and 1 (when a staging push happens we inc first then dec)
diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp
index b6271f63..2209365 100644
--- a/libs/hwui/ShadowTessellator.cpp
+++ b/libs/hwui/ShadowTessellator.cpp
@@ -17,7 +17,6 @@
 #include <math.h>
 #include <utils/Log.h>
 #include <utils/Trace.h>
-#include <utils/Vector.h>
 #include <utils/MathUtils.h>
 
 #include "AmbientShadow.h"
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp
index 17cb3a7..01f5e2d 100644
--- a/libs/hwui/TessellationCache.cpp
+++ b/libs/hwui/TessellationCache.cpp
@@ -225,13 +225,13 @@
         VertexBuffer& ambientBuffer, VertexBuffer& spotBuffer) {
 
     // tessellate caster outline into a 2d polygon
-    Vector<Vertex> casterVertices2d;
+    std::vector<Vertex> casterVertices2d;
     const float casterRefinementThreshold = 2.0f;
     PathTessellator::approximatePathOutlineVertices(*casterPerimeter,
             casterRefinementThreshold, casterVertices2d);
 
     // Shadow requires CCW for now. TODO: remove potential double-reverse
-    reverseVertexArray(casterVertices2d.editArray(), casterVertices2d.size());
+    reverseVertexArray(&casterVertices2d.front(), casterVertices2d.size());
 
     if (casterVertices2d.size() == 0) return;
 
@@ -250,7 +250,7 @@
 
     // map the centroid of the caster into 3d
     Vector2 centroid =  ShadowTessellator::centroid2d(
-            reinterpret_cast<const Vector2*>(casterVertices2d.array()),
+            reinterpret_cast<const Vector2*>(&casterVertices2d.front()),
             casterVertexCount);
     Vector3 centroid3d = {centroid.x, centroid.y, 0};
     mapPointFakeZ(centroid3d, casterTransformXY, casterTransformZ);
diff --git a/libs/hwui/TessellationCache.h b/libs/hwui/TessellationCache.h
index 3efeaf6..b54666b 100644
--- a/libs/hwui/TessellationCache.h
+++ b/libs/hwui/TessellationCache.h
@@ -19,7 +19,6 @@
 
 #include <utils/LruCache.h>
 #include <utils/Mutex.h>
-#include <utils/Vector.h>
 
 #include "Debug.h"
 #include "utils/Macros.h"
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index c4467f1..16f6f4b 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -216,14 +216,14 @@
 
 void TextureCache::releaseTexture(uint32_t pixelRefStableID) {
     Mutex::Autolock _l(mLock);
-    mGarbage.push(pixelRefStableID);
+    mGarbage.push_back(pixelRefStableID);
 }
 
 void TextureCache::clearGarbage() {
     Mutex::Autolock _l(mLock);
     size_t count = mGarbage.size();
     for (size_t i = 0; i < count; i++) {
-        uint32_t pixelRefId = mGarbage.itemAt(i);
+        uint32_t pixelRefId = mGarbage[i];
         mCache.remove(pixelRefId);
     }
     mGarbage.clear();
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h
index 7a7ee5a..ebd1885 100644
--- a/libs/hwui/TextureCache.h
+++ b/libs/hwui/TextureCache.h
@@ -21,10 +21,11 @@
 
 #include <utils/LruCache.h>
 #include <utils/Mutex.h>
-#include <utils/Vector.h>
 
 #include "Debug.h"
 
+#include <vector>
+
 namespace android {
 namespace uirenderer {
 
@@ -165,7 +166,7 @@
 
     bool mDebugEnabled;
 
-    Vector<uint32_t> mGarbage;
+    std::vector<uint32_t> mGarbage;
     mutable Mutex mLock;
 
     AssetAtlas* mAssetAtlas;
diff --git a/libs/hwui/Vertex.h b/libs/hwui/Vertex.h
index 11d0c4b..c1bf980 100644
--- a/libs/hwui/Vertex.h
+++ b/libs/hwui/Vertex.h
@@ -37,7 +37,6 @@
      */
     static float GeometryFudgeFactor() { return 0.0656f; }
 
-
     float x, y;
 
     static inline void set(Vertex* vertex, float x, float y) {
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index f2fa9cd..88c18a5 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -31,7 +31,6 @@
 #include <SkBitmap.h>
 #include <SkRect.h>
 #include <utils/Functor.h>
-#include <utils/Vector.h>
 
 #include <set>
 #include <string>
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index 5febbe0..0d2c7be 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -27,7 +27,6 @@
 #include <utils/Mutex.h>
 #include <utils/Timers.h>
 #include <utils/StrongPointer.h>
-#include <utils/Vector.h>
 
 #include "../Caches.h"
 #include "../IContextFactory.h"
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp
index e9dde29..a07845e 100644
--- a/libs/hwui/thread/TaskManager.cpp
+++ b/libs/hwui/thread/TaskManager.cpp
@@ -39,7 +39,7 @@
     for (int i = 0; i < workerCount; i++) {
         String8 name;
         name.appendFormat("hwuiTask%d", i + 1);
-        mThreads.add(new WorkerThread(name));
+        mThreads.push_back(new WorkerThread(name));
     }
 }
 
@@ -89,15 +89,14 @@
 
 bool TaskManager::WorkerThread::threadLoop() {
     mSignal.wait();
-    Vector<TaskWrapper> tasks;
+    std::vector<TaskWrapper> tasks;
     {
         Mutex::Autolock l(mLock);
-        tasks = mTasks;
-        mTasks.clear();
+        tasks.swap(mTasks);
     }
 
     for (size_t i = 0; i < tasks.size(); i++) {
-        const TaskWrapper& task = tasks.itemAt(i);
+        const TaskWrapper& task = tasks[i];
         task.mProcessor->process(task.mTask);
     }
 
@@ -111,14 +110,13 @@
         return false;
     }
 
-    ssize_t index;
     {
         Mutex::Autolock l(mLock);
-        index = mTasks.add(task);
+        mTasks.push_back(task);
     }
     mSignal.signal();
 
-    return index >= 0;
+    return true;
 }
 
 size_t TaskManager::WorkerThread::getTaskCount() const {
diff --git a/libs/hwui/thread/TaskManager.h b/libs/hwui/thread/TaskManager.h
index 10e8b9e..d0eb304 100644
--- a/libs/hwui/thread/TaskManager.h
+++ b/libs/hwui/thread/TaskManager.h
@@ -20,10 +20,11 @@
 #include <utils/Mutex.h>
 #include <utils/String8.h>
 #include <utils/Thread.h>
-#include <utils/Vector.h>
 
 #include "Signal.h"
 
+#include <vector>
+
 namespace android {
 namespace uirenderer {
 
@@ -89,7 +90,7 @@
 
         // Lock for the list of tasks
         mutable Mutex mLock;
-        Vector<TaskWrapper> mTasks;
+        std::vector<TaskWrapper> mTasks;
 
         // Signal used to wake up the thread when a new
         // task is available in the list
@@ -98,7 +99,7 @@
         const String8 mName;
     };
 
-    Vector<sp<WorkerThread> > mThreads;
+    std::vector<sp<WorkerThread> > mThreads;
 };
 
 }; // namespace uirenderer