Update hwui_unit_tests to support running with Vulkan backend.
Added Macros for RENDERTHREAD_TESTS which run these tests using specific backends. RENDERTHREAD_TESTS - Runs OpenGL, SkiaGL, and SkiaVulkan RENDERTHREAD_SKIA_TESTS - Runs SkiaGL and SkiaVulkan RENDERTHREAD_OPENGL_TESTS - Runs OpenGL Test: manual running of hwui_unit_tests Change-Id: Ia7420ee7a38803a15e2d58394d14b38cae8208d3
This commit is contained in:
@@ -131,7 +131,7 @@ void DeferredLayerUpdater::doUpdateVkTexImage() {
|
||||
mLayer->getApi(), Layer::Api::OpenGL, Layer::Api::Vulkan);
|
||||
|
||||
static const mat4 identityMatrix;
|
||||
updateLayer(false, identityMatrix.data);
|
||||
updateLayer(false, GL_NONE, identityMatrix.data);
|
||||
|
||||
VkLayer* vkLayer = static_cast<VkLayer*>(mLayer);
|
||||
vkLayer->updateTexture();
|
||||
@@ -139,26 +139,20 @@ void DeferredLayerUpdater::doUpdateVkTexImage() {
|
||||
|
||||
void DeferredLayerUpdater::updateLayer(bool forceFilter, GLenum renderTarget,
|
||||
const float* textureTransform) {
|
||||
LOG_ALWAYS_FATAL_IF(mLayer->getApi() != Layer::Api::OpenGL,
|
||||
"updateLayer non GL backend %x, GL %x, VK %x",
|
||||
mLayer->getApi(), Layer::Api::OpenGL, Layer::Api::Vulkan);
|
||||
|
||||
updateLayer(forceFilter, textureTransform);
|
||||
|
||||
GlLayer* glLayer = static_cast<GlLayer*>(mLayer);
|
||||
if (renderTarget != glLayer->getRenderTarget()) {
|
||||
glLayer->setRenderTarget(renderTarget);
|
||||
glLayer->bindTexture();
|
||||
glLayer->setFilter(GL_NEAREST, false, true);
|
||||
glLayer->setWrap(GL_CLAMP_TO_EDGE, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
void DeferredLayerUpdater::updateLayer(bool forceFilter, const float* textureTransform) {
|
||||
mLayer->setBlend(mBlend);
|
||||
mLayer->setForceFilter(forceFilter);
|
||||
mLayer->setSize(mWidth, mHeight);
|
||||
mLayer->getTexTransform().load(textureTransform);
|
||||
|
||||
if (mLayer->getApi() == Layer::Api::OpenGL) {
|
||||
GlLayer* glLayer = static_cast<GlLayer*>(mLayer);
|
||||
if (renderTarget != glLayer->getRenderTarget()) {
|
||||
glLayer->setRenderTarget(renderTarget);
|
||||
glLayer->bindTexture();
|
||||
glLayer->setFilter(GL_NEAREST, false, true);
|
||||
glLayer->setWrap(GL_CLAMP_TO_EDGE, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DeferredLayerUpdater::detachSurfaceTexture() {
|
||||
|
||||
@@ -114,7 +114,6 @@ private:
|
||||
|
||||
void doUpdateTexImage();
|
||||
void doUpdateVkTexImage();
|
||||
void updateLayer(bool forceFilter, const float* textureTransform);
|
||||
};
|
||||
|
||||
} /* namespace uirenderer */
|
||||
|
||||
@@ -222,6 +222,12 @@ RenderPipelineType Properties::getRenderPipelineType() {
|
||||
return sRenderPipelineType;
|
||||
}
|
||||
|
||||
#ifdef HWUI_GLES_WRAP_ENABLED
|
||||
void Properties::overrideRenderPipelineType(RenderPipelineType type) {
|
||||
sRenderPipelineType = type;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Properties::isSkiaEnabled() {
|
||||
auto renderType = getRenderPipelineType();
|
||||
return RenderPipelineType::SkiaGL == renderType
|
||||
|
||||
@@ -318,11 +318,15 @@ public:
|
||||
// any overhead they add
|
||||
static bool filterOutTestOverhead;
|
||||
|
||||
// Used for testing only to change the render pipeline.
|
||||
#ifdef HWUI_GLES_WRAP_ENABLED
|
||||
static void overrideRenderPipelineType(RenderPipelineType);
|
||||
#endif
|
||||
|
||||
private:
|
||||
static ProfileType sProfileType;
|
||||
static bool sDisableProfileBars;
|
||||
static RenderPipelineType sRenderPipelineType;
|
||||
|
||||
}; // class Caches
|
||||
|
||||
}; // namespace uirenderer
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
|
||||
#include <renderthread/EglManager.h>
|
||||
#include <renderthread/OpenGLPipeline.h>
|
||||
#include <pipeline/skia/SkiaOpenGLPipeline.h>
|
||||
#include <pipeline/skia/SkiaVulkanPipeline.h>
|
||||
#include <renderthread/VulkanManager.h>
|
||||
#include <utils/Unicode.h>
|
||||
#include <SkClipStack.h>
|
||||
|
||||
@@ -46,11 +49,25 @@ SkColor TestUtils::interpolateColor(float fraction, SkColor start, SkColor end)
|
||||
| (int)((startB + (int)(fraction * (endB - startB))));
|
||||
}
|
||||
|
||||
sp<DeferredLayerUpdater> TestUtils::createTextureLayerUpdater(
|
||||
renderthread::RenderThread& renderThread) {
|
||||
android::uirenderer::renderthread::IRenderPipeline* pipeline;
|
||||
if (Properties::getRenderPipelineType() == RenderPipelineType::OpenGL) {
|
||||
pipeline = new renderthread::OpenGLPipeline(renderThread);
|
||||
} else if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL) {
|
||||
pipeline = new skiapipeline::SkiaOpenGLPipeline(renderThread);
|
||||
} else {
|
||||
pipeline = new skiapipeline::SkiaVulkanPipeline(renderThread);
|
||||
}
|
||||
sp<DeferredLayerUpdater> layerUpdater = pipeline->createTextureLayer();
|
||||
delete pipeline;
|
||||
return layerUpdater;
|
||||
}
|
||||
|
||||
sp<DeferredLayerUpdater> TestUtils::createTextureLayerUpdater(
|
||||
renderthread::RenderThread& renderThread, uint32_t width, uint32_t height,
|
||||
const SkMatrix& transform) {
|
||||
renderthread::OpenGLPipeline pipeline(renderThread);
|
||||
sp<DeferredLayerUpdater> layerUpdater = pipeline.createTextureLayer();
|
||||
sp<DeferredLayerUpdater> layerUpdater = createTextureLayerUpdater(renderThread);
|
||||
layerUpdater->backingLayer()->getTransform().load(transform);
|
||||
layerUpdater->setSize(width, height);
|
||||
layerUpdater->setTransform(&transform);
|
||||
@@ -111,12 +128,20 @@ void TestUtils::drawUtf8ToCanvas(Canvas* canvas, const char* text,
|
||||
void TestUtils::TestTask::run() {
|
||||
// RenderState only valid once RenderThread is running, so queried here
|
||||
renderthread::RenderThread& renderThread = renderthread::RenderThread::getInstance();
|
||||
renderThread.eglManager().initialize();
|
||||
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
|
||||
renderThread.vulkanManager().initialize();
|
||||
} else {
|
||||
renderThread.eglManager().initialize();
|
||||
}
|
||||
|
||||
rtCallback(renderThread);
|
||||
|
||||
renderThread.renderState().flush(Caches::FlushMode::Full);
|
||||
renderThread.eglManager().destroy();
|
||||
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
|
||||
renderThread.vulkanManager().destroy();
|
||||
} else {
|
||||
renderThread.renderState().flush(Caches::FlushMode::Full);
|
||||
renderThread.eglManager().destroy();
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<uint16_t[]> TestUtils::asciiToUtf16(const char* str) {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <DeviceInfo.h>
|
||||
#include <DisplayList.h>
|
||||
#include <Matrix.h>
|
||||
#include <Properties.h>
|
||||
#include <Rect.h>
|
||||
#include <RenderNode.h>
|
||||
#include <hwui/Bitmap.h>
|
||||
@@ -51,6 +52,31 @@ namespace uirenderer {
|
||||
} else { \
|
||||
ADD_FAILURE() << "ClipState not a rect"; \
|
||||
}
|
||||
|
||||
#define INNER_PIPELINE_TEST(test_case_name, test_name, pipeline, functionCall) \
|
||||
TEST(test_case_name, test_name##_##pipeline) { \
|
||||
RenderPipelineType oldType = Properties::getRenderPipelineType(); \
|
||||
Properties::overrideRenderPipelineType(RenderPipelineType::pipeline); \
|
||||
functionCall; \
|
||||
Properties::overrideRenderPipelineType(oldType); \
|
||||
};
|
||||
|
||||
/**
|
||||
* Like gtests' TEST, but only runs with the OpenGL RenderPipelineType
|
||||
*/
|
||||
#define OPENGL_PIPELINE_TEST(test_case_name, test_name) \
|
||||
class test_case_name##_##test_name##_HwuiTest { \
|
||||
public: \
|
||||
static void doTheThing(); \
|
||||
}; \
|
||||
INNER_PIPELINE_TEST(test_case_name, test_name, OpenGL, \
|
||||
test_case_name##_##test_name##_HwuiTest::doTheThing()) \
|
||||
void test_case_name##_##test_name##_HwuiTest::doTheThing()
|
||||
|
||||
#define INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, pipeline) \
|
||||
INNER_PIPELINE_TEST(test_case_name, test_name, pipeline, \
|
||||
TestUtils::runOnRenderThread(test_case_name##_##test_name##_RenderThreadTest::doTheThing))
|
||||
|
||||
/**
|
||||
* Like gtest's TEST, but runs on the RenderThread, and 'renderThread' is passed, in top level scope
|
||||
* (for e.g. accessing its RenderState)
|
||||
@@ -60,9 +86,32 @@ namespace uirenderer {
|
||||
public: \
|
||||
static void doTheThing(renderthread::RenderThread& renderThread); \
|
||||
}; \
|
||||
TEST(test_case_name, test_name) { \
|
||||
TestUtils::runOnRenderThread(test_case_name##_##test_name##_RenderThreadTest::doTheThing); \
|
||||
INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, OpenGL); \
|
||||
INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaGL); \
|
||||
INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaVulkan); \
|
||||
void test_case_name##_##test_name##_RenderThreadTest::doTheThing(renderthread::RenderThread& renderThread)
|
||||
|
||||
/**
|
||||
* Like RENDERTHREAD_TEST, but only runs with the OpenGL RenderPipelineType
|
||||
*/
|
||||
#define RENDERTHREAD_OPENGL_PIPELINE_TEST(test_case_name, test_name) \
|
||||
class test_case_name##_##test_name##_RenderThreadTest { \
|
||||
public: \
|
||||
static void doTheThing(renderthread::RenderThread& renderThread); \
|
||||
}; \
|
||||
INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, OpenGL); \
|
||||
void test_case_name##_##test_name##_RenderThreadTest::doTheThing(renderthread::RenderThread& renderThread)
|
||||
|
||||
/**
|
||||
* Like RENDERTHREAD_TEST, but only runs with the Skia RenderPipelineTypes
|
||||
*/
|
||||
#define RENDERTHREAD_SKIA_PIPELINE_TEST(test_case_name, test_name) \
|
||||
class test_case_name##_##test_name##_RenderThreadTest { \
|
||||
public: \
|
||||
static void doTheThing(renderthread::RenderThread& renderThread); \
|
||||
}; \
|
||||
INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaGL); \
|
||||
INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaVulkan); \
|
||||
void test_case_name##_##test_name##_RenderThreadTest::doTheThing(renderthread::RenderThread& renderThread)
|
||||
|
||||
/**
|
||||
@@ -136,6 +185,9 @@ public:
|
||||
return Bitmap::allocateHeapBitmap(outBitmap, nullptr);
|
||||
}
|
||||
|
||||
static sp<DeferredLayerUpdater> createTextureLayerUpdater(
|
||||
renderthread::RenderThread& renderThread);
|
||||
|
||||
static sp<DeferredLayerUpdater> createTextureLayerUpdater(
|
||||
renderthread::RenderThread& renderThread, uint32_t width, uint32_t height,
|
||||
const SkMatrix& transform);
|
||||
|
||||
@@ -80,7 +80,7 @@ static void testUnmergedGlopDispatch(renderthread::RenderThread& renderThread, R
|
||||
<< "Glop(s) expected";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(BakedOpDispatcher, pathTexture_positionOvalArc) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(BakedOpDispatcher, pathTexture_positionOvalArc) {
|
||||
SkPaint strokePaint;
|
||||
strokePaint.setStyle(SkPaint::kStroke_Style);
|
||||
strokePaint.setStrokeWidth(4);
|
||||
@@ -113,7 +113,7 @@ RENDERTHREAD_TEST(BakedOpDispatcher, pathTexture_positionOvalArc) {
|
||||
testUnmergedGlopDispatch(renderThread, &ovalOp, textureGlopVerifier);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(BakedOpDispatcher, onLayerOp_bufferless) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(BakedOpDispatcher, onLayerOp_bufferless) {
|
||||
SkPaint layerPaint;
|
||||
layerPaint.setAlpha(128);
|
||||
OffscreenBuffer* buffer = nullptr; // no providing a buffer, should hit rect fallback case
|
||||
@@ -131,7 +131,7 @@ static int getGlopTransformFlags(renderthread::RenderThread& renderThread, Recor
|
||||
return result;
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(BakedOpDispatcher, offsetFlags) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(BakedOpDispatcher, offsetFlags) {
|
||||
Rect bounds(10, 15, 20, 25);
|
||||
SkPaint paint;
|
||||
SkPaint aaPaint;
|
||||
@@ -157,7 +157,7 @@ RENDERTHREAD_TEST(BakedOpDispatcher, offsetFlags) {
|
||||
<< "Expect an offset for non-AA lines.";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(BakedOpDispatcher, renderTextWithShadow) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(BakedOpDispatcher, renderTextWithShadow) {
|
||||
auto node = TestUtils::createNode<RecordingCanvas>(0, 0, 100, 100,
|
||||
[](RenderProperties& props, RecordingCanvas& canvas) {
|
||||
|
||||
@@ -232,7 +232,7 @@ static FloatColor makeFloatColor(uint32_t color) {
|
||||
return c;
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(BakedOpDispatcher, layerUpdateProperties) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(BakedOpDispatcher, layerUpdateProperties) {
|
||||
for (bool debugOverdraw : { false, true }) {
|
||||
for (bool debugLayersUpdates : { false, true }) {
|
||||
ScopedProperty<bool> ovdProp(Properties::debugOverdraw, debugOverdraw);
|
||||
@@ -273,7 +273,7 @@ RENDERTHREAD_TEST(BakedOpDispatcher, layerUpdateProperties) {
|
||||
}
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(BakedOpDispatcher, pathTextureSnapping) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(BakedOpDispatcher, pathTextureSnapping) {
|
||||
Rect bounds(10, 15, 20, 25);
|
||||
SkPaint paint;
|
||||
SkPath path;
|
||||
|
||||
@@ -23,7 +23,7 @@ using namespace android::uirenderer;
|
||||
|
||||
const BakedOpRenderer::LightInfo sLightInfo = { 128, 128 };
|
||||
|
||||
RENDERTHREAD_TEST(BakedOpRenderer, startRepaintLayer_clear) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(BakedOpRenderer, startRepaintLayer_clear) {
|
||||
BakedOpRenderer renderer(Caches::getInstance(), renderThread.renderState(), true, sLightInfo);
|
||||
OffscreenBuffer layer(renderThread.renderState(), Caches::getInstance(), 200u, 200u);
|
||||
|
||||
|
||||
@@ -46,5 +46,10 @@ RENDERTHREAD_TEST(CanvasContext, create) {
|
||||
RENDERTHREAD_TEST(CanvasContext, invokeFunctor) {
|
||||
TestUtils::MockFunctor functor;
|
||||
CanvasContext::invokeFunctor(renderThread, &functor);
|
||||
ASSERT_EQ(functor.getLastMode(), DrawGlInfo::kModeProcess);
|
||||
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
|
||||
// we currently don't support OpenGL WebViews on the Vulkan backend
|
||||
ASSERT_EQ(functor.getLastMode(), DrawGlInfo::kModeProcessNoContext);
|
||||
} else {
|
||||
ASSERT_EQ(functor.getLastMode(), DrawGlInfo::kModeProcess);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
#include "DeferredLayerUpdater.h"
|
||||
#include "GlLayer.h"
|
||||
#include "Properties.h"
|
||||
|
||||
#include "renderthread/OpenGLPipeline.h"
|
||||
#include "tests/common/TestUtils.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
@@ -26,12 +26,10 @@ using namespace android;
|
||||
using namespace android::uirenderer;
|
||||
|
||||
RENDERTHREAD_TEST(DeferredLayerUpdater, updateLayer) {
|
||||
renderthread::OpenGLPipeline pipeline(renderThread);
|
||||
sp<DeferredLayerUpdater> layerUpdater = pipeline.createTextureLayer();
|
||||
sp<DeferredLayerUpdater> layerUpdater = TestUtils::createTextureLayerUpdater(renderThread);
|
||||
layerUpdater->setSize(100, 100);
|
||||
layerUpdater->setBlend(true);
|
||||
|
||||
|
||||
// updates are deferred so the backing layer should still be in its default state
|
||||
if (layerUpdater->backingLayer()->getApi() == Layer::Api::OpenGL) {
|
||||
GlLayer* glLayer = static_cast<GlLayer*>(layerUpdater->backingLayer());
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
#include <DeviceInfo.h>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "tests/common/TestUtils.h"
|
||||
|
||||
using namespace android;
|
||||
using namespace android::uirenderer;
|
||||
|
||||
TEST(DeviceInfo, basic) {
|
||||
OPENGL_PIPELINE_TEST(DeviceInfo, basic) {
|
||||
// can't assert state before init - another test may have initialized the singleton
|
||||
DeviceInfo::initialize();
|
||||
const DeviceInfo* di = DeviceInfo::get();
|
||||
|
||||
@@ -28,7 +28,7 @@ static bool isZero(uint8_t* data, int size) {
|
||||
return true;
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FontRenderer, renderDropShadow) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FontRenderer, renderDropShadow) {
|
||||
SkPaint paint;
|
||||
paint.setTextSize(10);
|
||||
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
|
||||
class FailRenderer : public TestRendererBase {};
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, simple) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, simple) {
|
||||
class SimpleTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void startFrame(uint32_t width, uint32_t height, const Rect& repaintRect) override {
|
||||
@@ -143,7 +143,7 @@ RENDERTHREAD_TEST(FrameBuilder, simple) {
|
||||
EXPECT_EQ(4, renderer.getIndex()); // 2 ops + start + end
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, simpleStroke) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, simpleStroke) {
|
||||
class SimpleStrokeTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onPointsOp(const PointsOp& op, const BakedOpState& state) override {
|
||||
@@ -171,7 +171,7 @@ RENDERTHREAD_TEST(FrameBuilder, simpleStroke) {
|
||||
EXPECT_EQ(1, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, simpleRejection) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, simpleRejection) {
|
||||
auto node = TestUtils::createNode<RecordingCanvas>(0, 0, 200, 200,
|
||||
[](RenderProperties& props, RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
@@ -187,7 +187,7 @@ RENDERTHREAD_TEST(FrameBuilder, simpleRejection) {
|
||||
frameBuilder.replayBakedOps<TestDispatcher>(renderer);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, simpleBatching) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, simpleBatching) {
|
||||
const int LOOPS = 5;
|
||||
class SimpleBatchingTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
@@ -225,7 +225,7 @@ RENDERTHREAD_TEST(FrameBuilder, simpleBatching) {
|
||||
<< "Expect number of ops = 2 * loop count";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, deferRenderNode_translateClip) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, deferRenderNode_translateClip) {
|
||||
class DeferRenderNodeTranslateClipTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onRectOp(const RectOp& op, const BakedOpState& state) override {
|
||||
@@ -251,7 +251,7 @@ RENDERTHREAD_TEST(FrameBuilder, deferRenderNode_translateClip) {
|
||||
EXPECT_EQ(1, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, deferRenderNodeScene) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, deferRenderNodeScene) {
|
||||
class DeferRenderNodeSceneTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onRectOp(const RectOp& op, const BakedOpState& state) override {
|
||||
@@ -320,7 +320,7 @@ RENDERTHREAD_TEST(FrameBuilder, deferRenderNodeScene) {
|
||||
EXPECT_EQ(4, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, empty_noFbo0) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, empty_noFbo0) {
|
||||
class EmptyNoFbo0TestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void startFrame(uint32_t width, uint32_t height, const Rect& repaintRect) override {
|
||||
@@ -338,7 +338,7 @@ RENDERTHREAD_TEST(FrameBuilder, empty_noFbo0) {
|
||||
frameBuilder.replayBakedOps<TestDispatcher>(renderer);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, empty_withFbo0) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, empty_withFbo0) {
|
||||
class EmptyWithFbo0TestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void startFrame(uint32_t width, uint32_t height, const Rect& repaintRect) override {
|
||||
@@ -364,7 +364,7 @@ RENDERTHREAD_TEST(FrameBuilder, empty_withFbo0) {
|
||||
" but fbo0 update lifecycle should still be observed";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, avoidOverdraw_rects) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, avoidOverdraw_rects) {
|
||||
class AvoidOverdrawRectsTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onRectOp(const RectOp& op, const BakedOpState& state) override {
|
||||
@@ -394,7 +394,7 @@ RENDERTHREAD_TEST(FrameBuilder, avoidOverdraw_rects) {
|
||||
EXPECT_EQ(1, renderer.getIndex()) << "Expect exactly one op";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, avoidOverdraw_bitmaps) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, avoidOverdraw_bitmaps) {
|
||||
static sk_sp<Bitmap> opaqueBitmap(TestUtils::createBitmap(50, 50,
|
||||
SkColorType::kRGB_565_SkColorType));
|
||||
static sk_sp<Bitmap> transpBitmap(TestUtils::createBitmap(50, 50,
|
||||
@@ -437,7 +437,7 @@ RENDERTHREAD_TEST(FrameBuilder, avoidOverdraw_bitmaps) {
|
||||
EXPECT_EQ(2, renderer.getIndex()) << "Expect exactly two ops";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, clippedMerging) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, clippedMerging) {
|
||||
class ClippedMergingTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onMergedBitmapOps(const MergedBakedOpList& opList) override {
|
||||
@@ -479,7 +479,7 @@ RENDERTHREAD_TEST(FrameBuilder, clippedMerging) {
|
||||
EXPECT_EQ(4, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, regionClipStopsMerge) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, regionClipStopsMerge) {
|
||||
class RegionClipStopsMergeTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onTextOp(const TextOp& op, const BakedOpState& state) override { mIndex++; }
|
||||
@@ -508,7 +508,7 @@ RENDERTHREAD_TEST(FrameBuilder, regionClipStopsMerge) {
|
||||
EXPECT_EQ(2, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, textMerging) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, textMerging) {
|
||||
class TextMergingTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onMergedTextOps(const MergedBakedOpList& opList) override {
|
||||
@@ -538,7 +538,7 @@ RENDERTHREAD_TEST(FrameBuilder, textMerging) {
|
||||
EXPECT_EQ(2, renderer.getIndex()) << "Expect 2 ops";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, textStrikethrough) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, textStrikethrough) {
|
||||
const int LOOPS = 5;
|
||||
class TextStrikethroughTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
@@ -576,7 +576,7 @@ RENDERTHREAD_TEST(FrameBuilder, textStrikethrough) {
|
||||
static auto styles = {
|
||||
SkPaint::kFill_Style, SkPaint::kStroke_Style, SkPaint::kStrokeAndFill_Style };
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, textStyle) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, textStyle) {
|
||||
class TextStyleTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onMergedTextOps(const MergedBakedOpList& opList) override {
|
||||
@@ -630,7 +630,7 @@ RENDERTHREAD_TEST(FrameBuilder, textStyle) {
|
||||
EXPECT_EQ(3, renderer.getIndex()) << "Expect 3 ops";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, textureLayer_clipLocalMatrix) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, textureLayer_clipLocalMatrix) {
|
||||
class TextureLayerClipLocalMatrixTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onTextureLayerOp(const TextureLayerOp& op, const BakedOpState& state) override {
|
||||
@@ -664,7 +664,7 @@ RENDERTHREAD_TEST(FrameBuilder, textureLayer_clipLocalMatrix) {
|
||||
EXPECT_EQ(1, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, textureLayer_combineMatrices) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, textureLayer_combineMatrices) {
|
||||
class TextureLayerCombineMatricesTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onTextureLayerOp(const TextureLayerOp& op, const BakedOpState& state) override {
|
||||
@@ -696,10 +696,10 @@ RENDERTHREAD_TEST(FrameBuilder, textureLayer_combineMatrices) {
|
||||
EXPECT_EQ(1, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, textureLayer_reject) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, textureLayer_reject) {
|
||||
auto layerUpdater = TestUtils::createTextureLayerUpdater(renderThread, 100, 100,
|
||||
SkMatrix::MakeTrans(5, 5));
|
||||
if (layerUpdater->backingLayer()->getApi() != Layer::Api::OpenGL) return;
|
||||
EXPECT_EQ(Layer::Api::OpenGL, layerUpdater->backingLayer()->getApi());
|
||||
|
||||
GlLayer* glLayer = static_cast<GlLayer*>(layerUpdater->backingLayer());
|
||||
glLayer->setRenderTarget(GL_NONE); // Should be rejected
|
||||
@@ -717,7 +717,7 @@ RENDERTHREAD_TEST(FrameBuilder, textureLayer_reject) {
|
||||
frameBuilder.replayBakedOps<TestDispatcher>(renderer);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, functor_reject) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, functor_reject) {
|
||||
class FunctorTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onFunctorOp(const FunctorOp& op, const BakedOpState& state) override {
|
||||
@@ -742,7 +742,7 @@ RENDERTHREAD_TEST(FrameBuilder, functor_reject) {
|
||||
EXPECT_EQ(1, renderer.getIndex()) << "Functor should not be rejected";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, deferColorOp_unbounded) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, deferColorOp_unbounded) {
|
||||
class ColorTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onColorOp(const ColorOp& op, const BakedOpState& state) override {
|
||||
@@ -767,7 +767,7 @@ RENDERTHREAD_TEST(FrameBuilder, deferColorOp_unbounded) {
|
||||
EXPECT_EQ(1, renderer.getIndex()) << "ColorOp should not be rejected";
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, renderNode) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, renderNode) {
|
||||
class RenderNodeTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onRectOp(const RectOp& op, const BakedOpState& state) override {
|
||||
@@ -814,7 +814,7 @@ TEST(FrameBuilder, renderNode) {
|
||||
EXPECT_EQ(2, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, clipped) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, clipped) {
|
||||
class ClippedTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onBitmapOp(const BitmapOp& op, const BakedOpState& state) override {
|
||||
@@ -840,7 +840,7 @@ RENDERTHREAD_TEST(FrameBuilder, clipped) {
|
||||
frameBuilder.replayBakedOps<TestDispatcher>(renderer);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayer_simple) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayer_simple) {
|
||||
class SaveLayerSimpleTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
OffscreenBuffer* startTemporaryLayer(uint32_t width, uint32_t height) override {
|
||||
@@ -890,7 +890,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayer_simple) {
|
||||
EXPECT_EQ(5, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayer_nested) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayer_nested) {
|
||||
/* saveLayer1 { rect1, saveLayer2 { rect2 } } will play back as:
|
||||
* - startTemporaryLayer2, rect2 endLayer2
|
||||
* - startTemporaryLayer1, rect1, drawLayer2, endLayer1
|
||||
@@ -973,7 +973,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayer_nested) {
|
||||
EXPECT_EQ(12, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayer_contentRejection) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayer_contentRejection) {
|
||||
auto node = TestUtils::createNode<RecordingCanvas>(0, 0, 200, 200,
|
||||
[](RenderProperties& props, RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
@@ -996,7 +996,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayer_contentRejection) {
|
||||
frameBuilder.replayBakedOps<TestDispatcher>(renderer);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_simple) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayerUnclipped_simple) {
|
||||
class SaveLayerUnclippedSimpleTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onCopyToLayerOp(const CopyToLayerOp& op, const BakedOpState& state) override {
|
||||
@@ -1041,7 +1041,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_simple) {
|
||||
EXPECT_EQ(4, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_round) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayerUnclipped_round) {
|
||||
class SaveLayerUnclippedRoundTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onCopyToLayerOp(const CopyToLayerOp& op, const BakedOpState& state) override {
|
||||
@@ -1075,7 +1075,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_round) {
|
||||
EXPECT_EQ(2, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_mergedClears) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayerUnclipped_mergedClears) {
|
||||
class SaveLayerUnclippedMergedClearsTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onCopyToLayerOp(const CopyToLayerOp& op, const BakedOpState& state) override {
|
||||
@@ -1133,7 +1133,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_mergedClears) {
|
||||
<< "Expect 4 copyTos, 4 copyFroms, 1 clear SimpleRects, and 1 rect.";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_clearClip) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayerUnclipped_clearClip) {
|
||||
class SaveLayerUnclippedClearClipTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onCopyToLayerOp(const CopyToLayerOp& op, const BakedOpState& state) override {
|
||||
@@ -1175,7 +1175,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_clearClip) {
|
||||
EXPECT_EQ(4, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_reject) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayerUnclipped_reject) {
|
||||
auto node = TestUtils::createNode<RecordingCanvas>(0, 0, 200, 200,
|
||||
[](RenderProperties& props, RecordingCanvas& canvas) {
|
||||
// unclipped savelayer + rect both in area that won't intersect with dirty
|
||||
@@ -1197,7 +1197,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_reject) {
|
||||
* - startTemporaryLayer, onCopyToLayer, onSimpleRects, onRect, onCopyFromLayer, endLayer
|
||||
* - startFrame, onCopyToLayer, onSimpleRects, drawLayer, onCopyFromLayer, endframe
|
||||
*/
|
||||
RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_complex) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, saveLayerUnclipped_complex) {
|
||||
class SaveLayerUnclippedComplexTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
OffscreenBuffer* startTemporaryLayer(uint32_t width, uint32_t height) {
|
||||
@@ -1262,7 +1262,7 @@ RENDERTHREAD_TEST(FrameBuilder, saveLayerUnclipped_complex) {
|
||||
EXPECT_EQ(13, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, hwLayer_simple) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, hwLayer_simple) {
|
||||
class HwLayerSimpleTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void startRepaintLayer(OffscreenBuffer* offscreenBuffer, const Rect& repaintRect) override {
|
||||
@@ -1326,7 +1326,7 @@ RENDERTHREAD_TEST(FrameBuilder, hwLayer_simple) {
|
||||
*layerHandle = nullptr;
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, hwLayer_complex) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, hwLayer_complex) {
|
||||
/* parentLayer { greyRect, saveLayer { childLayer { whiteRect } } } will play back as:
|
||||
* - startRepaintLayer(child), rect(grey), endLayer
|
||||
* - startTemporaryLayer, drawLayer(child), endLayer
|
||||
@@ -1435,7 +1435,7 @@ RENDERTHREAD_TEST(FrameBuilder, hwLayer_complex) {
|
||||
}
|
||||
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, buildLayer) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, buildLayer) {
|
||||
class BuildLayerTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void startRepaintLayer(OffscreenBuffer* offscreenBuffer, const Rect& repaintRect) override {
|
||||
@@ -1531,7 +1531,7 @@ public:
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, zReorder) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, zReorder) {
|
||||
auto parent = TestUtils::createNode<RecordingCanvas>(0, 0, 100, 100,
|
||||
[](RenderProperties& props, RecordingCanvas& canvas) {
|
||||
canvas.insertReorderBarrier(true);
|
||||
@@ -1566,7 +1566,7 @@ RENDERTHREAD_TEST(FrameBuilder, zReorder) {
|
||||
EXPECT_EQ(13, renderer.getIndex());
|
||||
};
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, projectionReorder) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorder) {
|
||||
static const int scrollX = 5;
|
||||
static const int scrollY = 10;
|
||||
class ProjectionReorderTestRenderer : public TestRendererBase {
|
||||
@@ -1659,7 +1659,7 @@ RENDERTHREAD_TEST(FrameBuilder, projectionReorder) {
|
||||
EXPECT_EQ(3, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, projectionHwLayer) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, projectionHwLayer) {
|
||||
static const int scrollX = 5;
|
||||
static const int scrollY = 10;
|
||||
class ProjectionHwLayerTestRenderer : public TestRendererBase {
|
||||
@@ -1750,7 +1750,7 @@ RENDERTHREAD_TEST(FrameBuilder, projectionHwLayer) {
|
||||
*layerHandle = nullptr;
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, projectionChildScroll) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, projectionChildScroll) {
|
||||
static const int scrollX = 500000;
|
||||
static const int scrollY = 0;
|
||||
class ProjectionChildScrollTestRenderer : public TestRendererBase {
|
||||
@@ -1817,7 +1817,7 @@ static sp<RenderNode> createWhiteRectShadowCaster(float translationZ) {
|
||||
});
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, shadow) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, shadow) {
|
||||
class ShadowTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onShadowOp(const ShadowOp& op, const BakedOpState& state) override {
|
||||
@@ -1850,7 +1850,7 @@ RENDERTHREAD_TEST(FrameBuilder, shadow) {
|
||||
EXPECT_EQ(2, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, shadowSaveLayer) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, shadowSaveLayer) {
|
||||
class ShadowSaveLayerTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
OffscreenBuffer* startTemporaryLayer(uint32_t width, uint32_t height) override {
|
||||
@@ -1896,7 +1896,7 @@ RENDERTHREAD_TEST(FrameBuilder, shadowSaveLayer) {
|
||||
EXPECT_EQ(6, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, shadowHwLayer) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, shadowHwLayer) {
|
||||
class ShadowHwLayerTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void startRepaintLayer(OffscreenBuffer* offscreenBuffer, const Rect& repaintRect) override {
|
||||
@@ -1954,7 +1954,7 @@ RENDERTHREAD_TEST(FrameBuilder, shadowHwLayer) {
|
||||
*layerHandle = nullptr;
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, shadowLayering) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, shadowLayering) {
|
||||
class ShadowLayeringTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onShadowOp(const ShadowOp& op, const BakedOpState& state) override {
|
||||
@@ -1981,7 +1981,7 @@ RENDERTHREAD_TEST(FrameBuilder, shadowLayering) {
|
||||
EXPECT_EQ(4, renderer.getIndex());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, shadowClipping) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, shadowClipping) {
|
||||
class ShadowClippingTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onShadowOp(const ShadowOp& op, const BakedOpState& state) override {
|
||||
@@ -2041,7 +2041,7 @@ static void testProperty(std::function<void(RenderProperties&)> propSetupCallbac
|
||||
EXPECT_EQ(1, renderer.getIndex()) << "Should have seen one op";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, renderPropOverlappingRenderingAlpha) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, renderPropOverlappingRenderingAlpha) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.setAlpha(0.5f);
|
||||
properties.setHasOverlappingRendering(false);
|
||||
@@ -2050,7 +2050,7 @@ RENDERTHREAD_TEST(FrameBuilder, renderPropOverlappingRenderingAlpha) {
|
||||
});
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, renderPropClipping) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, renderPropClipping) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.setClipToBounds(true);
|
||||
properties.setClipBounds(Rect(10, 20, 300, 400));
|
||||
@@ -2060,7 +2060,7 @@ RENDERTHREAD_TEST(FrameBuilder, renderPropClipping) {
|
||||
});
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, renderPropRevealClip) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, renderPropRevealClip) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.mutableRevealClip().set(true, 50, 50, 25);
|
||||
}, [](const RectOp& op, const BakedOpState& state) {
|
||||
@@ -2071,7 +2071,7 @@ RENDERTHREAD_TEST(FrameBuilder, renderPropRevealClip) {
|
||||
});
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, renderPropOutlineClip) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, renderPropOutlineClip) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.mutableOutline().setShouldClip(true);
|
||||
properties.mutableOutline().setRoundRect(10, 20, 30, 40, 5.0f, 0.5f);
|
||||
@@ -2083,7 +2083,7 @@ RENDERTHREAD_TEST(FrameBuilder, renderPropOutlineClip) {
|
||||
});
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, renderPropTransform) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, renderPropTransform) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.setLeftTopRightBottom(10, 10, 110, 110);
|
||||
|
||||
@@ -2192,7 +2192,7 @@ void testSaveLayerAlphaClip(SaveLayerAlphaData* outObservedData,
|
||||
ASSERT_EQ(5, renderer.getIndex()) << "Test must trigger saveLayer alpha behavior.";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, renderPropSaveLayerAlphaClipBig) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, renderPropSaveLayerAlphaClipBig) {
|
||||
SaveLayerAlphaData observedData;
|
||||
testSaveLayerAlphaClip(&observedData, [](RenderProperties& properties) {
|
||||
properties.setTranslationX(10); // offset rendering content
|
||||
@@ -2211,7 +2211,7 @@ RENDERTHREAD_TEST(FrameBuilder, renderPropSaveLayerAlphaClipBig) {
|
||||
<< "expect drawLayer to be translated as part of being clipped";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, renderPropSaveLayerAlphaRotate) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, renderPropSaveLayerAlphaRotate) {
|
||||
SaveLayerAlphaData observedData;
|
||||
testSaveLayerAlphaClip(&observedData, [](RenderProperties& properties) {
|
||||
// Translate and rotate the view so that the only visible part is the top left corner of
|
||||
@@ -2230,7 +2230,7 @@ RENDERTHREAD_TEST(FrameBuilder, renderPropSaveLayerAlphaRotate) {
|
||||
EXPECT_MATRIX_APPROX_EQ(Matrix4::identity(), observedData.rectMatrix);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, renderPropSaveLayerAlphaScale) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, renderPropSaveLayerAlphaScale) {
|
||||
SaveLayerAlphaData observedData;
|
||||
testSaveLayerAlphaClip(&observedData, [](RenderProperties& properties) {
|
||||
properties.setPivotX(0);
|
||||
@@ -2244,7 +2244,7 @@ RENDERTHREAD_TEST(FrameBuilder, renderPropSaveLayerAlphaScale) {
|
||||
EXPECT_MATRIX_APPROX_EQ(Matrix4::identity(), observedData.rectMatrix);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(FrameBuilder, clip_replace) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, clip_replace) {
|
||||
class ClipReplaceTestRenderer : public TestRendererBase {
|
||||
public:
|
||||
void onColorOp(const ColorOp& op, const BakedOpState& state) override {
|
||||
@@ -2269,7 +2269,7 @@ RENDERTHREAD_TEST(FrameBuilder, clip_replace) {
|
||||
EXPECT_EQ(1, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderProjectedInMiddle) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderProjectedInMiddle) {
|
||||
/* R is backward projected on B
|
||||
A
|
||||
/ \
|
||||
@@ -2299,7 +2299,7 @@ TEST(FrameBuilder, projectionReorderProjectedInMiddle) {
|
||||
EXPECT_EQ(3, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderProjectLast) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderProjectLast) {
|
||||
/* R is backward projected on E
|
||||
A
|
||||
/ | \
|
||||
@@ -2331,7 +2331,7 @@ TEST(FrameBuilder, projectionReorderProjectLast) {
|
||||
EXPECT_EQ(4, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderNoReceivable) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderNoReceivable) {
|
||||
/* R is backward projected without receiver
|
||||
A
|
||||
/ \
|
||||
@@ -2360,7 +2360,7 @@ TEST(FrameBuilder, projectionReorderNoReceivable) {
|
||||
EXPECT_EQ(2, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderParentReceivable) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderParentReceivable) {
|
||||
/* R is backward projected on C
|
||||
A
|
||||
/ \
|
||||
@@ -2389,7 +2389,7 @@ TEST(FrameBuilder, projectionReorderParentReceivable) {
|
||||
EXPECT_EQ(3, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderSameNodeReceivable) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderSameNodeReceivable) {
|
||||
auto nodeA = TestUtils::createNode<RecordingCanvas>(0, 0, 100, 100,
|
||||
[](RenderProperties& props, RecordingCanvas& canvas) {
|
||||
drawOrderedNode(&canvas, 0, nullptr); //nodeB
|
||||
@@ -2412,7 +2412,7 @@ TEST(FrameBuilder, projectionReorderSameNodeReceivable) {
|
||||
EXPECT_EQ(2, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderProjectedSibling) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderProjectedSibling) {
|
||||
//TODO: this test together with the next "projectionReorderProjectedSibling2" likely expose a
|
||||
//bug in HWUI. First test draws R, while the second test does not draw R for a nearly identical
|
||||
//tree setup. The correct behaviour is to not draw R, because the receiver cannot be a sibling
|
||||
@@ -2445,7 +2445,7 @@ TEST(FrameBuilder, projectionReorderProjectedSibling) {
|
||||
EXPECT_EQ(3, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderProjectedSibling2) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderProjectedSibling2) {
|
||||
/* R is set to project on B, but R is not drawn because projecting on a sibling is not allowed.
|
||||
A
|
||||
|
|
||||
@@ -2478,7 +2478,7 @@ TEST(FrameBuilder, projectionReorderProjectedSibling2) {
|
||||
EXPECT_EQ(3, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderGrandparentReceivable) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderGrandparentReceivable) {
|
||||
/* R is backward projected on B
|
||||
A
|
||||
|
|
||||
@@ -2510,7 +2510,7 @@ TEST(FrameBuilder, projectionReorderGrandparentReceivable) {
|
||||
EXPECT_EQ(3, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderTwoReceivables) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderTwoReceivables) {
|
||||
/* B and G are receivables, R is backward projected
|
||||
A
|
||||
/ \
|
||||
@@ -2543,7 +2543,7 @@ TEST(FrameBuilder, projectionReorderTwoReceivables) {
|
||||
EXPECT_EQ(4, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderTwoReceivablesLikelyScenario) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderTwoReceivablesLikelyScenario) {
|
||||
/* B and G are receivables, G is backward projected
|
||||
A
|
||||
/ \
|
||||
@@ -2576,7 +2576,7 @@ TEST(FrameBuilder, projectionReorderTwoReceivablesLikelyScenario) {
|
||||
EXPECT_EQ(4, renderer.getIndex());
|
||||
}
|
||||
|
||||
TEST(FrameBuilder, projectionReorderTwoReceivablesDeeper) {
|
||||
OPENGL_PIPELINE_TEST(FrameBuilder, projectionReorderTwoReceivablesDeeper) {
|
||||
/* B and G are receivables, R is backward projected
|
||||
A
|
||||
/ \
|
||||
|
||||
@@ -116,7 +116,7 @@ static std::unique_ptr<Glop> blackUnitQuadGlop(RenderState& renderState) {
|
||||
return glop;
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(GlopBuilder, rectSnapTest) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(GlopBuilder, rectSnapTest) {
|
||||
RenderState& renderState = renderThread.renderState();
|
||||
Caches& caches = Caches::getInstance();
|
||||
SkPaint paint;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
using namespace android;
|
||||
using namespace android::uirenderer;
|
||||
|
||||
RENDERTHREAD_TEST(GradientCache, addRemove) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(GradientCache, addRemove) {
|
||||
Extensions extensions;
|
||||
GradientCache cache(extensions);
|
||||
ASSERT_LT(1000u, cache.getMaxSize()) << "Expect non-trivial size";
|
||||
|
||||
@@ -29,7 +29,7 @@ using namespace android::uirenderer;
|
||||
const FrameBuilder::LightGeometry sLightGeometery = { {100, 100, 100}, 50};
|
||||
const BakedOpRenderer::LightInfo sLightInfo = { 128, 128 };
|
||||
|
||||
RENDERTHREAD_TEST(LeakCheck, saveLayer_overdrawRejection) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(LeakCheck, saveLayer_overdrawRejection) {
|
||||
auto node = TestUtils::createNode(0, 0, 100, 100,
|
||||
[](RenderProperties& props, Canvas& canvas) {
|
||||
canvas.saveLayerAlpha(0, 0, 100, 100, 128, SaveFlags::ClipToLayer);
|
||||
@@ -49,7 +49,7 @@ RENDERTHREAD_TEST(LeakCheck, saveLayer_overdrawRejection) {
|
||||
frameBuilder.replayBakedOps<BakedOpDispatcher>(renderer);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(LeakCheck, saveLayerUnclipped_simple) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(LeakCheck, saveLayerUnclipped_simple) {
|
||||
auto node = TestUtils::createNode(0, 0, 200, 200,
|
||||
[](RenderProperties& props, Canvas& canvas) {
|
||||
canvas.saveLayerAlpha(10, 10, 190, 190, 128, (SaveFlags::Flags)(0));
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
using namespace android::uirenderer;
|
||||
using namespace testing;
|
||||
|
||||
RENDERTHREAD_TEST(MeshState, genOrUpdate) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(MeshState, genOrUpdate) {
|
||||
debug::ScopedReplaceDriver<debug::MockGlesDriver> driverRef;
|
||||
auto& mockGlDriver = driverRef.get();
|
||||
EXPECT_CALL(mockGlDriver, glGenBuffers_(_, _)).WillOnce(SetArgPointee<1>(35));
|
||||
@@ -33,4 +33,4 @@ RENDERTHREAD_TEST(MeshState, genOrUpdate) {
|
||||
|
||||
GLuint buffer = 0;
|
||||
renderThread.renderState().meshState().genOrUpdateMeshBuffer(&buffer, 10, nullptr, GL_DYNAMIC_DRAW);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ TEST(OffscreenBuffer, computeIdealDimension) {
|
||||
EXPECT_EQ(1024u, OffscreenBuffer::computeIdealDimension(1000));
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(OffscreenBuffer, construct) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(OffscreenBuffer, construct) {
|
||||
OffscreenBuffer layer(renderThread.renderState(), Caches::getInstance(), 49u, 149u);
|
||||
EXPECT_EQ(49u, layer.viewportWidth);
|
||||
EXPECT_EQ(149u, layer.viewportHeight);
|
||||
@@ -41,7 +41,7 @@ RENDERTHREAD_TEST(OffscreenBuffer, construct) {
|
||||
EXPECT_EQ(64u * 192u * 4u, layer.getSizeInBytes());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(OffscreenBuffer, getTextureCoordinates) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(OffscreenBuffer, getTextureCoordinates) {
|
||||
OffscreenBuffer layerAligned(renderThread.renderState(), Caches::getInstance(), 256u, 256u);
|
||||
EXPECT_EQ(Rect(0, 1, 1, 0),
|
||||
layerAligned.getTextureCoordinates());
|
||||
@@ -51,7 +51,7 @@ RENDERTHREAD_TEST(OffscreenBuffer, getTextureCoordinates) {
|
||||
layerUnaligned.getTextureCoordinates());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(OffscreenBuffer, dirty) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(OffscreenBuffer, dirty) {
|
||||
OffscreenBuffer buffer(renderThread.renderState(), Caches::getInstance(), 256u, 256u);
|
||||
buffer.dirty(Rect(-100, -100, 100, 100));
|
||||
EXPECT_EQ(android::Rect(100, 100), buffer.region.getBounds());
|
||||
@@ -65,7 +65,7 @@ RENDERTHREAD_TEST(OffscreenBufferPool, construct) {
|
||||
<< "pool must read size from Properties";
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(OffscreenBufferPool, getPutClear) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(OffscreenBufferPool, getPutClear) {
|
||||
OffscreenBufferPool pool;
|
||||
|
||||
auto layer = pool.get(renderThread.renderState(), 100u, 200u);
|
||||
@@ -88,7 +88,7 @@ RENDERTHREAD_TEST(OffscreenBufferPool, getPutClear) {
|
||||
EXPECT_EQ(0u, pool.getCount());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(OffscreenBufferPool, resize) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(OffscreenBufferPool, resize) {
|
||||
OffscreenBufferPool pool;
|
||||
|
||||
auto layer = pool.get(renderThread.renderState(), 64u, 64u);
|
||||
@@ -123,7 +123,7 @@ RENDERTHREAD_TEST(OffscreenBufferPool, resize) {
|
||||
pool.putOrDelete(layer2);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(OffscreenBufferPool, putAndDestroy) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(OffscreenBufferPool, putAndDestroy) {
|
||||
OffscreenBufferPool pool;
|
||||
// layer too big to return to the pool
|
||||
// Note: this relies on the fact that the pool won't reject based on max texture size
|
||||
@@ -133,7 +133,7 @@ RENDERTHREAD_TEST(OffscreenBufferPool, putAndDestroy) {
|
||||
EXPECT_EQ(0u, pool.getCount()); // failed to put (so was destroyed instead)
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(OffscreenBufferPool, clear) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(OffscreenBufferPool, clear) {
|
||||
EXPECT_EQ(0, GpuMemoryTracker::getInstanceCount(GpuObjectType::OffscreenBuffer));
|
||||
OffscreenBufferPool pool;
|
||||
|
||||
|
||||
@@ -47,7 +47,13 @@ static void validateSingleOp(std::unique_ptr<DisplayList>& dl,
|
||||
opValidator(*(dl->getOps()[0]));
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, emptyPlayback) {
|
||||
// The RecordingCanvas is only ever used by the OpenGL RenderPipeline and never when Skia is in use.
|
||||
// Thus, even though many of these test are not directly dependent on the current RenderPipeline, we
|
||||
// set them all to be OPENGL_PIPELINE_TESTs in case the underlying code in RecordingCanvas ever
|
||||
// changes to require the use of the OPENGL_PIPELINE. Currently the textureLayer test is the only
|
||||
// test that requires being an OPENGL_PIPELINE_TEST.
|
||||
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, emptyPlayback) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
canvas.restore();
|
||||
@@ -55,7 +61,7 @@ TEST(RecordingCanvas, emptyPlayback) {
|
||||
playbackOps(*dl, [](const RecordedOp& op) { ADD_FAILURE(); });
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, clipRect) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, clipRect) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 100, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
canvas.clipRect(0, 0, 100, 100, SkClipOp::kIntersect);
|
||||
@@ -71,7 +77,7 @@ TEST(RecordingCanvas, clipRect) {
|
||||
<< "Clip should be serialized once";
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, emptyClipRect) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, emptyClipRect) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
canvas.clipRect(0, 0, 100, 100, SkClipOp::kIntersect);
|
||||
@@ -82,7 +88,7 @@ TEST(RecordingCanvas, emptyClipRect) {
|
||||
ASSERT_EQ(0u, dl->getOps().size()) << "Must be zero ops. Rect should be rejected.";
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, emptyPaintRejection) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, emptyPaintRejection) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
SkPaint emptyPaint;
|
||||
emptyPaint.setColor(Color::Transparent);
|
||||
@@ -103,7 +109,7 @@ TEST(RecordingCanvas, emptyPaintRejection) {
|
||||
EXPECT_EQ(0u, dl->getOps().size()) << "Op should be rejected";
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawArc) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawArc) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.drawArc(0, 0, 200, 200, 0, 180, true, SkPaint());
|
||||
canvas.drawArc(0, 0, 100, 100, 0, 360, true, SkPaint());
|
||||
@@ -119,7 +125,7 @@ TEST(RecordingCanvas, drawArc) {
|
||||
EXPECT_EQ(Rect(100, 100), ops[1]->unmappedBounds);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawLines) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawLines) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
|
||||
SkPaint paint;
|
||||
paint.setStrokeWidth(20); // doesn't affect recorded bounds - would be resolved at bake time
|
||||
@@ -136,7 +142,7 @@ TEST(RecordingCanvas, drawLines) {
|
||||
<< "unmapped bounds must be size of line, and not outset for stroke width";
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawRect) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawRect) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.drawRect(10, 20, 90, 180, SkPaint());
|
||||
});
|
||||
@@ -148,7 +154,7 @@ TEST(RecordingCanvas, drawRect) {
|
||||
EXPECT_EQ(Rect(10, 20, 90, 180), op.unmappedBounds);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawRoundRect) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawRoundRect) {
|
||||
// Round case - stays rounded
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.drawRoundRect(0, 0, 100, 100, 10, 10, SkPaint());
|
||||
@@ -165,7 +171,7 @@ TEST(RecordingCanvas, drawRoundRect) {
|
||||
<< "Non-rounded rects should be converted";
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawGlyphs) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawGlyphs) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
@@ -186,7 +192,7 @@ TEST(RecordingCanvas, drawGlyphs) {
|
||||
ASSERT_EQ(1, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawGlyphs_strikeThruAndUnderline) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawGlyphs_strikeThruAndUnderline) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
@@ -218,7 +224,7 @@ TEST(RecordingCanvas, drawGlyphs_strikeThruAndUnderline) {
|
||||
EXPECT_EQ(RecordedOpId::RectOp, ops[index++]->opId); // strikethrough
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawGlyphs_forceAlignLeft) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawGlyphs_forceAlignLeft) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
@@ -248,7 +254,7 @@ TEST(RecordingCanvas, drawGlyphs_forceAlignLeft) {
|
||||
ASSERT_EQ(3, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawColor) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawColor) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.drawColor(Color::Black, SkBlendMode::kSrcOver);
|
||||
});
|
||||
@@ -260,7 +266,7 @@ TEST(RecordingCanvas, drawColor) {
|
||||
EXPECT_TRUE(op.unmappedBounds.isEmpty()) << "Expect undefined recorded bounds";
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, backgroundAndImage) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, backgroundAndImage) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
|
||||
sk_sp<Bitmap> bitmap(TestUtils::createBitmap(25, 25));
|
||||
SkPaint paint;
|
||||
@@ -312,7 +318,7 @@ TEST(RecordingCanvas, backgroundAndImage) {
|
||||
ASSERT_EQ(2, count);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(RecordingCanvas, textureLayer) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(RecordingCanvas, textureLayer) {
|
||||
auto layerUpdater = TestUtils::createTextureLayerUpdater(renderThread, 100, 100,
|
||||
SkMatrix::MakeTrans(5, 5));
|
||||
|
||||
@@ -327,7 +333,7 @@ RENDERTHREAD_TEST(RecordingCanvas, textureLayer) {
|
||||
});
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_simple) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_simple) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.saveLayerAlpha(10, 20, 190, 180, 128, SaveFlags::ClipToLayer);
|
||||
canvas.drawRect(10, 20, 190, 180, SkPaint());
|
||||
@@ -361,7 +367,7 @@ TEST(RecordingCanvas, saveLayer_simple) {
|
||||
EXPECT_EQ(3, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_rounding) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_rounding) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 100, [](RecordingCanvas& canvas) {
|
||||
canvas.saveLayerAlpha(10.25f, 10.75f, 89.25f, 89.75f, 128, SaveFlags::ClipToLayer);
|
||||
canvas.drawRect(20, 20, 80, 80, SkPaint());
|
||||
@@ -391,7 +397,7 @@ TEST(RecordingCanvas, saveLayer_rounding) {
|
||||
EXPECT_EQ(3, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_missingRestore) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_missingRestore) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.saveLayerAlpha(0, 0, 200, 200, 128, SaveFlags::ClipToLayer);
|
||||
canvas.drawRect(0, 0, 200, 200, SkPaint());
|
||||
@@ -406,7 +412,7 @@ TEST(RecordingCanvas, saveLayer_missingRestore) {
|
||||
EXPECT_EQ(3, count) << "Missing a restore shouldn't result in an unmatched saveLayer";
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_simpleUnclipped) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_simpleUnclipped) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.saveLayerAlpha(10, 20, 190, 180, 128, (SaveFlags::Flags)0); // unclipped
|
||||
canvas.drawRect(10, 20, 190, 180, SkPaint());
|
||||
@@ -438,7 +444,7 @@ TEST(RecordingCanvas, saveLayer_simpleUnclipped) {
|
||||
EXPECT_EQ(3, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_addClipFlag) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_addClipFlag) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
canvas.clipRect(10, 20, 190, 180, SkClipOp::kIntersect);
|
||||
@@ -457,7 +463,7 @@ TEST(RecordingCanvas, saveLayer_addClipFlag) {
|
||||
EXPECT_EQ(3, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_viewportCrop) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_viewportCrop) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
// shouldn't matter, since saveLayer will clip to its bounds
|
||||
canvas.clipRect(-1000, -1000, 1000, 1000, SkClipOp::kReplace);
|
||||
@@ -481,7 +487,7 @@ TEST(RecordingCanvas, saveLayer_viewportCrop) {
|
||||
EXPECT_EQ(3, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_rotateUnclipped) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_rotateUnclipped) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
canvas.translate(100, 100);
|
||||
@@ -507,7 +513,7 @@ TEST(RecordingCanvas, saveLayer_rotateUnclipped) {
|
||||
EXPECT_EQ(3, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_rotateClipped) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_rotateClipped) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
canvas.translate(100, 100);
|
||||
@@ -545,7 +551,7 @@ TEST(RecordingCanvas, saveLayer_rotateClipped) {
|
||||
EXPECT_EQ(3, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, saveLayer_rejectBegin) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, saveLayer_rejectBegin) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
canvas.translate(0, -20); // avoid identity case
|
||||
@@ -560,7 +566,7 @@ TEST(RecordingCanvas, saveLayer_rejectBegin) {
|
||||
ASSERT_EQ(0u, dl->getOps().size()) << "Begin/Rect/End should all be rejected.";
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawRenderNode_rejection) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawRenderNode_rejection) {
|
||||
auto child = TestUtils::createNode(50, 50, 150, 150,
|
||||
[](RenderProperties& props, Canvas& canvas) {
|
||||
SkPaint paint;
|
||||
@@ -575,7 +581,7 @@ TEST(RecordingCanvas, drawRenderNode_rejection) {
|
||||
ASSERT_TRUE(dl->isEmpty());
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawRenderNode_projection) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawRenderNode_projection) {
|
||||
sp<RenderNode> background = TestUtils::createNode(50, 50, 150, 150,
|
||||
[](RenderProperties& props, Canvas& canvas) {
|
||||
SkPaint paint;
|
||||
@@ -618,7 +624,7 @@ TEST(RecordingCanvas, drawRenderNode_projection) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, firstClipWillReplace) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, firstClipWillReplace) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
// since no explicit clip set on canvas, this should be the one observed on op:
|
||||
@@ -635,7 +641,7 @@ TEST(RecordingCanvas, firstClipWillReplace) {
|
||||
EXPECT_CLIP_RECT(Rect(-100, -100, 300, 300), dl->getOps()[0]->localClip);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, replaceClipIntersectWithRoot) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, replaceClipIntersectWithRoot) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 100, [](RecordingCanvas& canvas) {
|
||||
canvas.save(SaveFlags::MatrixClip);
|
||||
canvas.clipRect(-10, -10, 110, 110, SkClipOp::kReplace);
|
||||
@@ -648,7 +654,7 @@ TEST(RecordingCanvas, replaceClipIntersectWithRoot) {
|
||||
EXPECT_TRUE(dl->getOps()[0]->localClip->intersectWithRoot);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, insertReorderBarrier) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, insertReorderBarrier) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.drawRect(0, 0, 400, 400, SkPaint());
|
||||
canvas.insertReorderBarrier(true);
|
||||
@@ -669,7 +675,7 @@ TEST(RecordingCanvas, insertReorderBarrier) {
|
||||
EXPECT_TRUE(chunks[1].reorderChildren);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, insertReorderBarrier_clip) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, insertReorderBarrier_clip) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
// first chunk: no recorded clip
|
||||
canvas.insertReorderBarrier(true);
|
||||
@@ -699,7 +705,7 @@ TEST(RecordingCanvas, insertReorderBarrier_clip) {
|
||||
EXPECT_EQ(Rect(200, 200), chunks[2].reorderClip->rect);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, refPaint) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, refPaint) {
|
||||
SkPaint paint;
|
||||
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [&paint](RecordingCanvas& canvas) {
|
||||
@@ -727,7 +733,7 @@ TEST(RecordingCanvas, refPaint) {
|
||||
EXPECT_NE(&paint, ops[2]->paint);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, refBitmap) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, refBitmap) {
|
||||
sk_sp<Bitmap> bitmap(TestUtils::createBitmap(100, 100));
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 100, [&bitmap](RecordingCanvas& canvas) {
|
||||
canvas.drawBitmap(*bitmap, 0, 0, nullptr);
|
||||
@@ -736,7 +742,7 @@ TEST(RecordingCanvas, refBitmap) {
|
||||
EXPECT_EQ(1u, bitmaps.size());
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, refBitmapInShader_bitmapShader) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, refBitmapInShader_bitmapShader) {
|
||||
sk_sp<Bitmap> bitmap = TestUtils::createBitmap(100, 100);
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 100, [&bitmap](RecordingCanvas& canvas) {
|
||||
SkPaint paint;
|
||||
@@ -755,7 +761,7 @@ TEST(RecordingCanvas, refBitmapInShader_bitmapShader) {
|
||||
EXPECT_EQ(1u, bitmaps.size());
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, refBitmapInShader_composeShader) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, refBitmapInShader_composeShader) {
|
||||
sk_sp<Bitmap> bitmap = TestUtils::createBitmap(100, 100);
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(100, 100, [&bitmap](RecordingCanvas& canvas) {
|
||||
SkPaint paint;
|
||||
@@ -785,7 +791,7 @@ TEST(RecordingCanvas, refBitmapInShader_composeShader) {
|
||||
EXPECT_EQ(1u, bitmaps.size());
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawText) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawText) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
Paint paint;
|
||||
paint.setAntiAlias(true);
|
||||
@@ -807,7 +813,7 @@ TEST(RecordingCanvas, drawText) {
|
||||
ASSERT_EQ(1, count);
|
||||
}
|
||||
|
||||
TEST(RecordingCanvas, drawTextInHighContrast) {
|
||||
OPENGL_PIPELINE_TEST(RecordingCanvas, drawTextInHighContrast) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
canvas.setHighContrastText(true);
|
||||
Paint paint;
|
||||
|
||||
@@ -137,10 +137,11 @@ RENDERTHREAD_TEST(RenderNode, prepareTree_nullableDisplayList) {
|
||||
RENDERTHREAD_TEST(RenderNode, prepareTree_HwLayer_AVD_enqueueDamage) {
|
||||
|
||||
VectorDrawable::Group* group = new VectorDrawable::Group();
|
||||
VectorDrawableRoot* vectorDrawable = new VectorDrawableRoot(group);
|
||||
sp<VectorDrawableRoot> vectorDrawable(new VectorDrawableRoot(group));
|
||||
|
||||
auto rootNode = TestUtils::createNode(0, 0, 200, 400,
|
||||
[&](RenderProperties& props, Canvas& canvas) {
|
||||
canvas.drawVectorDrawable(vectorDrawable);
|
||||
canvas.drawVectorDrawable(vectorDrawable.get());
|
||||
});
|
||||
ContextFactory contextFactory;
|
||||
std::unique_ptr<CanvasContext> canvasContext(CanvasContext::create(
|
||||
@@ -164,7 +165,5 @@ RENDERTHREAD_TEST(RenderNode, prepareTree_HwLayer_AVD_enqueueDamage) {
|
||||
EXPECT_FALSE(info.layerUpdateQueue->entries().empty());
|
||||
EXPECT_EQ(rootNode.get(), info.layerUpdateQueue->entries().at(0).renderNode);
|
||||
EXPECT_EQ(uirenderer::Rect(0, 0, 200, 400), info.layerUpdateQueue->entries().at(0).damage);
|
||||
|
||||
delete vectorDrawable;
|
||||
canvasContext->destroy(nullptr);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ using namespace android::uirenderer;
|
||||
* Verify that we get the same culling bounds for text for (1) drawing glyphs
|
||||
* directly to a Canvas or (2) going through a SkPicture as an intermediate step.
|
||||
*/
|
||||
TEST(SkiaCanvasProxy, drawGlyphsViaPicture) {
|
||||
OPENGL_PIPELINE_TEST(SkiaCanvasProxy, drawGlyphsViaPicture) {
|
||||
auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
|
||||
// setup test variables
|
||||
SkPaint paint;
|
||||
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
RENDERTHREAD_TEST(SkiaDisplayList, prepareListAndChildren) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaDisplayList, prepareListAndChildren) {
|
||||
auto rootNode = TestUtils::createNode(0, 0, 200, 400, nullptr);
|
||||
ContextFactory contextFactory;
|
||||
std::unique_ptr<CanvasContext> canvasContext(CanvasContext::create(
|
||||
|
||||
@@ -36,7 +36,7 @@ using namespace android::uirenderer;
|
||||
using namespace android::uirenderer::renderthread;
|
||||
using namespace android::uirenderer::skiapipeline;
|
||||
|
||||
RENDERTHREAD_TEST(SkiaPipeline, renderFrame) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderFrame) {
|
||||
auto redNode = TestUtils::createSkiaNode(0, 0, 1, 1,
|
||||
[](RenderProperties& props, SkiaRecordingCanvas& redCanvas) {
|
||||
redCanvas.drawColor(SK_ColorRED, SkBlendMode::kSrcOver);
|
||||
@@ -55,7 +55,7 @@ RENDERTHREAD_TEST(SkiaPipeline, renderFrame) {
|
||||
ASSERT_EQ(TestUtils::getColor(surface, 0, 0), SK_ColorRED);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(SkiaPipeline, renderFrameCheckOpaque) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderFrameCheckOpaque) {
|
||||
auto halfGreenNode = TestUtils::createSkiaNode(0, 0, 2, 2,
|
||||
[](RenderProperties& props, SkiaRecordingCanvas& bottomHalfGreenCanvas) {
|
||||
SkPaint greenPaint;
|
||||
@@ -80,7 +80,7 @@ RENDERTHREAD_TEST(SkiaPipeline, renderFrameCheckOpaque) {
|
||||
ASSERT_EQ(TestUtils::getColor(surface, 0, 1), SK_ColorGREEN);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(SkiaPipeline, renderFrameCheckDirtyRect) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderFrameCheckDirtyRect) {
|
||||
auto redNode = TestUtils::createSkiaNode(0, 0, 2, 2,
|
||||
[](RenderProperties& props, SkiaRecordingCanvas& redCanvas) {
|
||||
redCanvas.drawColor(SK_ColorRED, SkBlendMode::kSrcOver);
|
||||
@@ -101,7 +101,7 @@ RENDERTHREAD_TEST(SkiaPipeline, renderFrameCheckDirtyRect) {
|
||||
ASSERT_EQ(TestUtils::getColor(surface, 1, 1), SK_ColorRED);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(SkiaPipeline, renderLayer) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderLayer) {
|
||||
auto redNode = TestUtils::createSkiaNode(0, 0, 1, 1,
|
||||
[](RenderProperties& props, SkiaRecordingCanvas& redCanvas) {
|
||||
redCanvas.drawColor(SK_ColorRED, SkBlendMode::kSrcOver);
|
||||
@@ -144,7 +144,7 @@ RENDERTHREAD_TEST(SkiaPipeline, renderLayer) {
|
||||
blueNode->setLayerSurface(sk_sp<SkSurface>());
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(SkiaPipeline, renderOverdraw) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderOverdraw) {
|
||||
ScopedProperty<bool> prop(Properties::debugOverdraw, true);
|
||||
|
||||
auto whiteNode = TestUtils::createSkiaNode(0, 0, 1, 1,
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(SkiaPipeline, deferRenderNodeScene) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, deferRenderNodeScene) {
|
||||
class DeferTestCanvas : public SkCanvas {
|
||||
public:
|
||||
DeferTestCanvas() : SkCanvas(800, 600) {}
|
||||
@@ -284,7 +284,7 @@ RENDERTHREAD_TEST(SkiaPipeline, deferRenderNodeScene) {
|
||||
EXPECT_EQ(4, surface->canvas()->mDrawCounter);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(SkiaPipeline, clipped) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, clipped) {
|
||||
static const int CANVAS_WIDTH = 200;
|
||||
static const int CANVAS_HEIGHT = 200;
|
||||
class ClippedTestCanvas : public SkCanvas {
|
||||
@@ -315,7 +315,7 @@ RENDERTHREAD_TEST(SkiaPipeline, clipped) {
|
||||
EXPECT_EQ(1, surface->canvas()->mDrawCounter);
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(SkiaPipeline, clip_replace) {
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, clip_replace) {
|
||||
static const int CANVAS_WIDTH = 50;
|
||||
static const int CANVAS_HEIGHT = 50;
|
||||
class ClipReplaceTestCanvas : public SkCanvas {
|
||||
|
||||
@@ -73,7 +73,7 @@ static void testProperty(std::function<void(RenderProperties&)> propSetupCallbac
|
||||
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(RenderNodeDrawable, renderPropClipping) {
|
||||
TEST(RenderNodeDrawable, renderPropClipping) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.setClipToBounds(true);
|
||||
properties.setClipBounds(android::uirenderer::Rect(10, 20, 300, 400));
|
||||
@@ -83,7 +83,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, renderPropClipping) {
|
||||
});
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(RenderNodeDrawable, renderPropRevealClip) {
|
||||
TEST(RenderNodeDrawable, renderPropRevealClip) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.mutableRevealClip().set(true, 50, 50, 25);
|
||||
}, [](const SkCanvas& canvas) {
|
||||
@@ -98,7 +98,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, renderPropRevealClip) {
|
||||
});
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(RenderNodeDrawable, renderPropOutlineClip) {
|
||||
TEST(RenderNodeDrawable, renderPropOutlineClip) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.mutableOutline().setShouldClip(true);
|
||||
properties.mutableOutline().setRoundRect(10, 20, 30, 40, 5.0f, 0.5f);
|
||||
@@ -114,7 +114,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, renderPropOutlineClip) {
|
||||
});
|
||||
}
|
||||
|
||||
RENDERTHREAD_TEST(RenderNodeDrawable, renderPropTransform) {
|
||||
TEST(RenderNodeDrawable, renderPropTransform) {
|
||||
testProperty([](RenderProperties& properties) {
|
||||
properties.setLeftTopRightBottom(10, 10, 110, 110);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
using namespace android;
|
||||
using namespace android::uirenderer;
|
||||
|
||||
RENDERTHREAD_TEST(TextDropShadowCache, addRemove) {
|
||||
RENDERTHREAD_OPENGL_PIPELINE_TEST(TextDropShadowCache, addRemove) {
|
||||
SkPaint paint;
|
||||
paint.setTextSize(20);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user