diff options
author | Derek Sollenberger <djsollen@google.com> | 2017-08-31 15:40:12 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2017-08-31 15:50:41 -0400 |
commit | 7fe53c1eafff36118d9d6116496d7649b5a3f89d (patch) | |
tree | ef8e584e0c905e8d2161d5884b45a4cffc7c6cd7 /libs/hwui/pipeline/skia/VectorDrawableAtlas.cpp | |
parent | 9552c2c98c8d9a5a47ec463a2f29e5aa32f774bb (diff) |
Render VectorDrawables in software and then upload to the VDAtlas.
For frames with multiple VDs the context switching involved was causing
worst case frame times of ~40ms to draw all VDs in the frame whereas
this new approach has worst case performance of ~5ms when drawing the
same frame (w/ approximately 26 VDs).
Bug: 64487466
Test: SystemUiJankTests#testGoToFullShade
Change-Id: I5cad0b5df86e5eac3722ee8695fc7511b38b8a7c
Diffstat (limited to 'libs/hwui/pipeline/skia/VectorDrawableAtlas.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/VectorDrawableAtlas.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/hwui/pipeline/skia/VectorDrawableAtlas.cpp b/libs/hwui/pipeline/skia/VectorDrawableAtlas.cpp index 23969908ff4d..9c9e17d600bf 100644 --- a/libs/hwui/pipeline/skia/VectorDrawableAtlas.cpp +++ b/libs/hwui/pipeline/skia/VectorDrawableAtlas.cpp @@ -270,7 +270,10 @@ sk_sp<SkSurface> VectorDrawableAtlas::createSurface(int width, int height, GrCon sk_sp<SkColorSpace> colorSpace = SkColorSpace::MakeSRGB(); #endif SkImageInfo info = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType, colorSpace); - return SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info); + // This must have a top-left origin so that calls to surface->canvas->writePixels + // performs a basic texture upload instead of a more complex drawing operation + return SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, 0, + kTopLeft_GrSurfaceOrigin, nullptr); } void VectorDrawableAtlas::setStorageMode(StorageMode mode) { |