diff options
author | Chris Craik <ccraik@google.com> | 2015-02-05 10:12:38 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-02-06 13:42:25 -0800 |
commit | 117bdbcfa3e8306dad21e7e01fa71b00cdfa7265 (patch) | |
tree | aa54e4a5538818cd946bbd6e7eb771b83d0cfebd /libs/hwui/tests | |
parent | 34725687748cc2b4ace2bdb49becfdcd569e9a5d (diff) | |
download | frameworks_base-117bdbcfa3e8306dad21e7e01fa71b00cdfa7265.zip frameworks_base-117bdbcfa3e8306dad21e7e01fa71b00cdfa7265.tar.gz frameworks_base-117bdbcfa3e8306dad21e7e01fa71b00cdfa7265.tar.bz2 |
Glop ColorFilter & VertexBuffer support, initial enable
Enables Glop rendering for supported Rects and VertexBuffers
Also removes unused Query object
Change-Id: Ibe227bc362685a153159f75077664f0947764e06
Diffstat (limited to 'libs/hwui/tests')
-rw-r--r-- | libs/hwui/tests/main.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libs/hwui/tests/main.cpp b/libs/hwui/tests/main.cpp index 1e7ba23..5f445f4 100644 --- a/libs/hwui/tests/main.cpp +++ b/libs/hwui/tests/main.cpp @@ -201,6 +201,45 @@ private: } }; +class OvalAnimation : public TreeContentAnimation { +public: + sp<RenderNode> card; + void createContent(int width, int height, DisplayListRenderer* renderer) override { + android::uirenderer::Rect DUMMY; + + renderer->drawColor(0xFFFFFFFF, SkXfermode::kSrcOver_Mode); + renderer->insertReorderBarrier(true); + + card = createCard(40, 40, 200, 200); + renderer->drawRenderNode(card.get(), DUMMY, 0); + + renderer->insertReorderBarrier(false); + } + + void doFrame(int frameNr) override { + card->mutateStagingProperties().setTranslationX(frameNr); + card->mutateStagingProperties().setTranslationY(frameNr); + card->setPropertyFieldsDirty(RenderNode::X | RenderNode::Y); + } +private: + sp<RenderNode> createCard(int x, int y, int width, int height) { + sp<RenderNode> node = new RenderNode(); + node->mutateStagingProperties().setLeftTopRightBottom(x, y, x + width, y + height); + node->setPropertyFieldsDirty(RenderNode::X | RenderNode::Y); + + DisplayListRenderer* renderer = startRecording(node.get()); + renderer->drawColor(0xFFFF00FF, SkXfermode::kSrcOver_Mode); + + SkPaint paint; + paint.setAntiAlias(true); + paint.setColor(0xFF00FFFF); + renderer->drawOval(0, 0, width, height, paint); + + endRecording(renderer, node.get()); + return node; + } +}; + struct cstr_cmp { bool operator()(const char *a, const char *b) const { return std::strcmp(a, b) < 0; @@ -212,6 +251,7 @@ typedef void (*testProc)(); std::map<const char*, testProc, cstr_cmp> gTestMap { {"shadowgrid", TreeContentAnimation::run<ShadowGridAnimation>}, {"rectgrid", TreeContentAnimation::run<RectGridAnimation> }, + {"oval", TreeContentAnimation::run<OvalAnimation> }, }; int main(int argc, char* argv[]) { |