Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d5278b6 authored by Derek Sollenberger's avatar Derek Sollenberger
Browse files

Update TestWindowContext to work with new HWUI ops.

This enables HWUI to be testing within Skia's infrastructure and
fixes skia bug 4775.

Change-Id: I242b9e4c5ed0f4523b6075d8825a2624235a01c7
parent 16548a3e
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "AnimationContext.h"
#include "DisplayListCanvas.h"
#include "IContextFactory.h"
#include "RecordingCanvas.h"
#include "RenderNode.h"
#include "SkTypes.h"
#include "gui/BufferQueue.h"
@@ -88,9 +89,11 @@ public:
        mProxy->setup(mSize.width(), mSize.height(), 800.0f,
                             255 * 0.075f, 255 * 0.15f);
        mProxy->setLightCenter(lightVector);
        mCanvas.reset(new
            android::uirenderer::DisplayListCanvas(mSize.width(),
                                                   mSize.height()));
#if HWUI_NEW_OPS
        mCanvas.reset(new android::uirenderer::RecordingCanvas(mSize.width(), mSize.height()));
#else
        mCanvas.reset(new android::uirenderer::DisplayListCanvas(mSize.width(), mSize.height()));
#endif
    }

    SkCanvas* prepareToDraw() {
@@ -168,7 +171,11 @@ private:

    std::unique_ptr<android::uirenderer::RenderNode> mRootNode;
    std::unique_ptr<android::uirenderer::renderthread::RenderProxy> mProxy;
#if HWUI_NEW_OPS
    std::unique_ptr<android::uirenderer::RecordingCanvas> mCanvas;
#else
    std::unique_ptr<android::uirenderer::DisplayListCanvas> mCanvas;
#endif
    android::sp<android::IGraphicBufferProducer> mProducer;
    android::sp<android::IGraphicBufferConsumer> mConsumer;
    android::sp<android::CpuConsumer> mCpuConsumer;