OSDN Git Service

use writepixels on surface, the canvas version is deprecated
authorMike Reed <reed@google.com>
Thu, 8 Feb 2018 21:28:53 +0000 (16:28 -0500)
committerMike Reed <reed@google.com>
Fri, 9 Feb 2018 17:06:01 +0000 (12:06 -0500)
Test: make

Change-Id: I6af16bf4a8c9952d2e493cbd34b6db58d581a694

libs/hwui/VectorDrawable.cpp

index f662406..18358e2 100644 (file)
@@ -518,10 +518,7 @@ void Tree::updateCache(sp<skiapipeline::VectorDrawableAtlas>& atlas, GrContext*
             Bitmap& bitmap = getBitmapUpdateIfDirty();
             SkBitmap skiaBitmap;
             bitmap.getSkBitmap(&skiaBitmap);
-            if (!surface->getCanvas()->writePixels(skiaBitmap, dst.fLeft, dst.fTop)) {
-                ALOGD("VectorDrawable caching failed to efficiently upload");
-                surface->getCanvas()->drawBitmap(skiaBitmap, dst.fLeft, dst.fTop);
-            }
+            surface->writePixels(skiaBitmap, dst.fLeft, dst.fTop);
         }
         mCache.dirty = false;
     }