Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <gtest/gtest.h> |
| 18 | |
| 19 | #include <renderengine/RenderEngine.h> |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 20 | #include <sync/sync.h> |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 21 | #include <ui/PixelFormat.h> |
| 22 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 23 | constexpr int DEFAULT_DISPLAY_WIDTH = 128; |
| 24 | constexpr int DEFAULT_DISPLAY_HEIGHT = 256; |
| 25 | constexpr int DEFAULT_DISPLAY_OFFSET = 64; |
| 26 | |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 27 | namespace android { |
| 28 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 29 | struct RenderEngineTest : public ::testing::Test { |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 30 | static sp<GraphicBuffer> allocateDefaultBuffer() { |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 31 | return new GraphicBuffer(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT, |
| 32 | HAL_PIXEL_FORMAT_RGBA_8888, 1, |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 33 | GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN | |
| 34 | GRALLOC_USAGE_HW_RENDER, |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 35 | "output"); |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 36 | } |
| 37 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 38 | // Allocates a 1x1 buffer to fill with a solid color |
| 39 | static sp<GraphicBuffer> allocateSourceBuffer(uint32_t width, uint32_t height) { |
| 40 | return new GraphicBuffer(width, height, HAL_PIXEL_FORMAT_RGBA_8888, 1, |
| 41 | GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN | |
| 42 | GRALLOC_USAGE_HW_TEXTURE, |
| 43 | "input"); |
| 44 | } |
| 45 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 46 | RenderEngineTest() { mBuffer = allocateDefaultBuffer(); } |
| 47 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 48 | ~RenderEngineTest() { |
| 49 | for (uint32_t texName : mTexNames) { |
| 50 | sRE->deleteTextures(1, &texName); |
| 51 | } |
| 52 | } |
| 53 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 54 | void expectBufferColor(const Rect& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a, |
| 55 | uint8_t tolerance = 0) { |
| 56 | uint8_t* pixels; |
| 57 | mBuffer->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN, |
| 58 | reinterpret_cast<void**>(&pixels)); |
| 59 | |
| 60 | auto colorCompare = [tolerance](uint8_t a, uint8_t b) { |
| 61 | uint8_t tmp = a >= b ? a - b : b - a; |
| 62 | return tmp <= tolerance; |
| 63 | }; |
| 64 | int32_t maxFails = 10; |
| 65 | int32_t fails = 0; |
| 66 | for (int32_t j = 0; j < region.getHeight(); j++) { |
| 67 | const uint8_t* src = |
| 68 | pixels + (mBuffer->getStride() * (region.top + j) + region.left) * 4; |
| 69 | for (int32_t i = 0; i < region.getWidth(); i++) { |
| 70 | const uint8_t expected[4] = {r, g, b, a}; |
| 71 | bool equal = std::equal(src, src + 4, expected, colorCompare); |
| 72 | EXPECT_TRUE(equal) |
| 73 | << "pixel @ (" << region.left + i << ", " << region.top + j << "): " |
| 74 | << "expected (" << static_cast<uint32_t>(r) << ", " |
| 75 | << static_cast<uint32_t>(g) << ", " << static_cast<uint32_t>(b) << ", " |
| 76 | << static_cast<uint32_t>(a) << "), " |
| 77 | << "got (" << static_cast<uint32_t>(src[0]) << ", " |
| 78 | << static_cast<uint32_t>(src[1]) << ", " << static_cast<uint32_t>(src[2]) |
| 79 | << ", " << static_cast<uint32_t>(src[3]) << ")"; |
| 80 | src += 4; |
| 81 | if (!equal && ++fails >= maxFails) { |
| 82 | break; |
| 83 | } |
| 84 | } |
| 85 | if (fails >= maxFails) { |
| 86 | break; |
| 87 | } |
| 88 | } |
| 89 | mBuffer->unlock(); |
| 90 | } |
| 91 | |
| 92 | static Rect fullscreenRect() { return Rect(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT); } |
| 93 | |
| 94 | static Rect offsetRect() { |
| 95 | return Rect(DEFAULT_DISPLAY_OFFSET, DEFAULT_DISPLAY_OFFSET, DEFAULT_DISPLAY_WIDTH, |
| 96 | DEFAULT_DISPLAY_HEIGHT); |
| 97 | } |
| 98 | |
| 99 | static Rect offsetRectAtZero() { |
| 100 | return Rect(DEFAULT_DISPLAY_WIDTH - DEFAULT_DISPLAY_OFFSET, |
| 101 | DEFAULT_DISPLAY_HEIGHT - DEFAULT_DISPLAY_OFFSET); |
| 102 | } |
| 103 | |
| 104 | static void invokeDraw(renderengine::DisplaySettings settings, |
| 105 | std::vector<renderengine::LayerSettings> layers, |
| 106 | sp<GraphicBuffer> buffer) { |
| 107 | base::unique_fd fence; |
| 108 | status_t status = sRE->drawLayers(settings, layers, buffer->getNativeBuffer(), &fence); |
| 109 | |
| 110 | int fd = fence.release(); |
| 111 | if (fd >= 0) { |
| 112 | sync_wait(fd, -1); |
| 113 | close(fd); |
| 114 | } |
| 115 | |
| 116 | ASSERT_EQ(NO_ERROR, status); |
| 117 | } |
| 118 | |
| 119 | static void drawEmptyLayers() { |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 120 | renderengine::DisplaySettings settings; |
| 121 | std::vector<renderengine::LayerSettings> layers; |
| 122 | // Meaningless buffer since we don't do any drawing |
| 123 | sp<GraphicBuffer> buffer = new GraphicBuffer(); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 124 | invokeDraw(settings, layers, buffer); |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 127 | template <typename SourceVariant> |
| 128 | void fillBuffer(half r, half g, half b, half a); |
| 129 | |
| 130 | template <typename SourceVariant> |
| 131 | void fillRedBuffer(); |
| 132 | |
| 133 | template <typename SourceVariant> |
| 134 | void fillGreenBuffer(); |
| 135 | |
| 136 | template <typename SourceVariant> |
| 137 | void fillBlueBuffer(); |
| 138 | |
| 139 | template <typename SourceVariant> |
| 140 | void fillRedTransparentBuffer(); |
| 141 | |
| 142 | template <typename SourceVariant> |
| 143 | void fillRedOffsetBuffer(); |
| 144 | |
| 145 | template <typename SourceVariant> |
| 146 | void fillBufferPhysicalOffset(); |
| 147 | |
| 148 | template <typename SourceVariant> |
| 149 | void fillBufferCheckers(mat4 transform); |
| 150 | |
| 151 | template <typename SourceVariant> |
| 152 | void fillBufferCheckersRotate0(); |
| 153 | |
| 154 | template <typename SourceVariant> |
| 155 | void fillBufferCheckersRotate90(); |
| 156 | |
| 157 | template <typename SourceVariant> |
| 158 | void fillBufferCheckersRotate180(); |
| 159 | |
| 160 | template <typename SourceVariant> |
| 161 | void fillBufferCheckersRotate270(); |
| 162 | |
| 163 | template <typename SourceVariant> |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 164 | void fillBufferWithLayerTransform(); |
| 165 | |
| 166 | template <typename SourceVariant> |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 167 | void fillBufferLayerTransform(); |
| 168 | |
| 169 | template <typename SourceVariant> |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 170 | void fillBufferWithColorTransform(); |
| 171 | |
| 172 | template <typename SourceVariant> |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 173 | void fillBufferColorTransform(); |
| 174 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 175 | void fillRedBufferTextureTransform(); |
| 176 | |
| 177 | void fillBufferTextureTransform(); |
| 178 | |
| 179 | void fillRedBufferWithPremultiplyAlpha(); |
| 180 | |
| 181 | void fillBufferWithPremultiplyAlpha(); |
| 182 | |
| 183 | void fillRedBufferWithoutPremultiplyAlpha(); |
| 184 | |
| 185 | void fillBufferWithoutPremultiplyAlpha(); |
| 186 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 187 | // Dumb hack to get aroud the fact that tear-down for renderengine isn't |
| 188 | // well defined right now, so we can't create multiple instances |
| 189 | static std::unique_ptr<renderengine::RenderEngine> sRE; |
| 190 | |
| 191 | sp<GraphicBuffer> mBuffer; |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 192 | |
| 193 | std::vector<uint32_t> mTexNames; |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 194 | }; |
| 195 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 196 | std::unique_ptr<renderengine::RenderEngine> RenderEngineTest::sRE = |
| 197 | renderengine::RenderEngine::create(static_cast<int32_t>(ui::PixelFormat::RGBA_8888), 0); |
| 198 | |
| 199 | struct ColorSourceVariant { |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 200 | static void fillColor(renderengine::LayerSettings& layer, half r, half g, half b, |
| 201 | RenderEngineTest* /*fixture*/) { |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 202 | layer.source.solidColor = half3(r, g, b); |
| 203 | } |
| 204 | }; |
| 205 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 206 | struct RelaxOpaqueBufferVariant { |
| 207 | static void setOpaqueBit(renderengine::LayerSettings& layer) { |
| 208 | layer.source.buffer.isOpaque = false; |
| 209 | } |
| 210 | |
| 211 | static uint8_t getAlphaChannel() { return 255; } |
| 212 | }; |
| 213 | |
| 214 | struct ForceOpaqueBufferVariant { |
| 215 | static void setOpaqueBit(renderengine::LayerSettings& layer) { |
| 216 | layer.source.buffer.isOpaque = true; |
| 217 | } |
| 218 | |
| 219 | static uint8_t getAlphaChannel() { |
| 220 | // The isOpaque bit will override the alpha channel, so this should be |
| 221 | // arbitrary. |
| 222 | return 10; |
| 223 | } |
| 224 | }; |
| 225 | |
| 226 | template <typename OpaquenessVariant> |
| 227 | struct BufferSourceVariant { |
| 228 | static void fillColor(renderengine::LayerSettings& layer, half r, half g, half b, |
| 229 | RenderEngineTest* fixture) { |
| 230 | sp<GraphicBuffer> buf = RenderEngineTest::allocateSourceBuffer(1, 1); |
| 231 | uint32_t texName; |
| 232 | RenderEngineTest::sRE->genTextures(1, &texName); |
| 233 | fixture->mTexNames.push_back(texName); |
| 234 | |
| 235 | uint8_t* pixels; |
| 236 | buf->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN, |
| 237 | reinterpret_cast<void**>(&pixels)); |
| 238 | |
| 239 | for (int32_t j = 0; j < buf->getHeight(); j++) { |
| 240 | uint8_t* iter = pixels + (buf->getStride() * j) * 4; |
| 241 | for (int32_t i = 0; i < buf->getWidth(); i++) { |
| 242 | iter[0] = uint8_t(r * 255); |
| 243 | iter[1] = uint8_t(g * 255); |
| 244 | iter[2] = uint8_t(b * 255); |
| 245 | iter[3] = OpaquenessVariant::getAlphaChannel(); |
| 246 | iter += 4; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | buf->unlock(); |
| 251 | |
| 252 | layer.source.buffer.buffer = buf; |
| 253 | layer.source.buffer.textureName = texName; |
| 254 | OpaquenessVariant::setOpaqueBit(layer); |
| 255 | } |
| 256 | }; |
| 257 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 258 | template <typename SourceVariant> |
| 259 | void RenderEngineTest::fillBuffer(half r, half g, half b, half a) { |
| 260 | renderengine::DisplaySettings settings; |
| 261 | settings.physicalDisplay = fullscreenRect(); |
| 262 | settings.clip = fullscreenRect(); |
| 263 | |
| 264 | std::vector<renderengine::LayerSettings> layers; |
| 265 | |
| 266 | renderengine::LayerSettings layer; |
| 267 | layer.geometry.boundaries = fullscreenRect().toFloatRect(); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 268 | SourceVariant::fillColor(layer, r, g, b, this); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 269 | layer.alpha = a; |
| 270 | |
| 271 | layers.push_back(layer); |
| 272 | |
| 273 | invokeDraw(settings, layers, mBuffer); |
| 274 | } |
| 275 | |
| 276 | template <typename SourceVariant> |
| 277 | void RenderEngineTest::fillRedBuffer() { |
| 278 | fillBuffer<SourceVariant>(1.0f, 0.0f, 0.0f, 1.0f); |
| 279 | expectBufferColor(fullscreenRect(), 255, 0, 0, 255); |
| 280 | } |
| 281 | |
| 282 | template <typename SourceVariant> |
| 283 | void RenderEngineTest::fillGreenBuffer() { |
| 284 | fillBuffer<SourceVariant>(0.0f, 1.0f, 0.0f, 1.0f); |
| 285 | expectBufferColor(fullscreenRect(), 0, 255, 0, 255); |
| 286 | } |
| 287 | |
| 288 | template <typename SourceVariant> |
| 289 | void RenderEngineTest::fillBlueBuffer() { |
| 290 | fillBuffer<SourceVariant>(0.0f, 0.0f, 1.0f, 1.0f); |
| 291 | expectBufferColor(fullscreenRect(), 0, 0, 255, 255); |
| 292 | } |
| 293 | |
| 294 | template <typename SourceVariant> |
| 295 | void RenderEngineTest::fillRedTransparentBuffer() { |
| 296 | fillBuffer<SourceVariant>(1.0f, 0.0f, 0.0f, .2f); |
| 297 | expectBufferColor(fullscreenRect(), 51, 0, 0, 51); |
| 298 | } |
| 299 | |
| 300 | template <typename SourceVariant> |
| 301 | void RenderEngineTest::fillRedOffsetBuffer() { |
| 302 | renderengine::DisplaySettings settings; |
| 303 | settings.physicalDisplay = offsetRect(); |
| 304 | settings.clip = offsetRectAtZero(); |
| 305 | |
| 306 | std::vector<renderengine::LayerSettings> layers; |
| 307 | |
| 308 | renderengine::LayerSettings layer; |
| 309 | layer.geometry.boundaries = offsetRectAtZero().toFloatRect(); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 310 | SourceVariant::fillColor(layer, 1.0f, 0.0f, 0.0f, this); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 311 | layer.alpha = 1.0f; |
| 312 | |
| 313 | layers.push_back(layer); |
| 314 | invokeDraw(settings, layers, mBuffer); |
| 315 | } |
| 316 | |
| 317 | template <typename SourceVariant> |
| 318 | void RenderEngineTest::fillBufferPhysicalOffset() { |
| 319 | fillRedOffsetBuffer<SourceVariant>(); |
| 320 | |
| 321 | expectBufferColor(Rect(DEFAULT_DISPLAY_OFFSET, DEFAULT_DISPLAY_OFFSET, DEFAULT_DISPLAY_WIDTH, |
| 322 | DEFAULT_DISPLAY_HEIGHT), |
| 323 | 255, 0, 0, 255); |
| 324 | Rect offsetRegionLeft(DEFAULT_DISPLAY_OFFSET, DEFAULT_DISPLAY_HEIGHT); |
| 325 | Rect offsetRegionTop(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_OFFSET); |
| 326 | |
| 327 | expectBufferColor(offsetRegionLeft, 0, 0, 0, 0); |
| 328 | expectBufferColor(offsetRegionTop, 0, 0, 0, 0); |
| 329 | } |
| 330 | |
| 331 | template <typename SourceVariant> |
| 332 | void RenderEngineTest::fillBufferCheckers(mat4 transform) { |
| 333 | renderengine::DisplaySettings settings; |
| 334 | settings.physicalDisplay = fullscreenRect(); |
| 335 | // Here logical space is 2x2 |
| 336 | settings.clip = Rect(2, 2); |
| 337 | settings.globalTransform = transform; |
| 338 | |
| 339 | std::vector<renderengine::LayerSettings> layers; |
| 340 | |
| 341 | renderengine::LayerSettings layerOne; |
| 342 | Rect rectOne(0, 0, 1, 1); |
| 343 | layerOne.geometry.boundaries = rectOne.toFloatRect(); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 344 | SourceVariant::fillColor(layerOne, 1.0f, 0.0f, 0.0f, this); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 345 | layerOne.alpha = 1.0f; |
| 346 | |
| 347 | renderengine::LayerSettings layerTwo; |
| 348 | Rect rectTwo(0, 1, 1, 2); |
| 349 | layerTwo.geometry.boundaries = rectTwo.toFloatRect(); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 350 | SourceVariant::fillColor(layerTwo, 0.0f, 1.0f, 0.0f, this); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 351 | layerTwo.alpha = 1.0f; |
| 352 | |
| 353 | renderengine::LayerSettings layerThree; |
| 354 | Rect rectThree(1, 0, 2, 1); |
| 355 | layerThree.geometry.boundaries = rectThree.toFloatRect(); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 356 | SourceVariant::fillColor(layerThree, 0.0f, 0.0f, 1.0f, this); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 357 | layerThree.alpha = 1.0f; |
| 358 | |
| 359 | layers.push_back(layerOne); |
| 360 | layers.push_back(layerTwo); |
| 361 | layers.push_back(layerThree); |
| 362 | |
| 363 | invokeDraw(settings, layers, mBuffer); |
| 364 | } |
| 365 | |
| 366 | template <typename SourceVariant> |
| 367 | void RenderEngineTest::fillBufferCheckersRotate0() { |
| 368 | fillBufferCheckers<SourceVariant>(mat4()); |
| 369 | expectBufferColor(Rect(0, 0, DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2), 255, 0, 0, |
| 370 | 255); |
| 371 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, 0, DEFAULT_DISPLAY_WIDTH, |
| 372 | DEFAULT_DISPLAY_HEIGHT / 2), |
| 373 | 0, 0, 255, 255); |
| 374 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2, |
| 375 | DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT), |
| 376 | 0, 0, 0, 0); |
| 377 | expectBufferColor(Rect(0, DEFAULT_DISPLAY_HEIGHT / 2, DEFAULT_DISPLAY_WIDTH / 2, |
| 378 | DEFAULT_DISPLAY_HEIGHT), |
| 379 | 0, 255, 0, 255); |
| 380 | } |
| 381 | |
| 382 | template <typename SourceVariant> |
| 383 | void RenderEngineTest::fillBufferCheckersRotate90() { |
| 384 | mat4 matrix = mat4(0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1); |
| 385 | fillBufferCheckers<SourceVariant>(matrix); |
| 386 | expectBufferColor(Rect(0, 0, DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2), 0, 255, 0, |
| 387 | 255); |
| 388 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, 0, DEFAULT_DISPLAY_WIDTH, |
| 389 | DEFAULT_DISPLAY_HEIGHT / 2), |
| 390 | 255, 0, 0, 255); |
| 391 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2, |
| 392 | DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT), |
| 393 | 0, 0, 255, 255); |
| 394 | expectBufferColor(Rect(0, DEFAULT_DISPLAY_HEIGHT / 2, DEFAULT_DISPLAY_WIDTH / 2, |
| 395 | DEFAULT_DISPLAY_HEIGHT), |
| 396 | 0, 0, 0, 0); |
| 397 | } |
| 398 | |
| 399 | template <typename SourceVariant> |
| 400 | void RenderEngineTest::fillBufferCheckersRotate180() { |
| 401 | mat4 matrix = mat4(-1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 2, 2, 0, 1); |
| 402 | fillBufferCheckers<SourceVariant>(matrix); |
| 403 | expectBufferColor(Rect(0, 0, DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2), 0, 0, 0, |
| 404 | 0); |
| 405 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, 0, DEFAULT_DISPLAY_WIDTH, |
| 406 | DEFAULT_DISPLAY_HEIGHT / 2), |
| 407 | 0, 255, 0, 255); |
| 408 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2, |
| 409 | DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT), |
| 410 | 255, 0, 0, 255); |
| 411 | expectBufferColor(Rect(0, DEFAULT_DISPLAY_HEIGHT / 2, DEFAULT_DISPLAY_WIDTH / 2, |
| 412 | DEFAULT_DISPLAY_HEIGHT), |
| 413 | 0, 0, 255, 255); |
| 414 | } |
| 415 | |
| 416 | template <typename SourceVariant> |
| 417 | void RenderEngineTest::fillBufferCheckersRotate270() { |
| 418 | mat4 matrix = mat4(0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 1); |
| 419 | fillBufferCheckers<SourceVariant>(matrix); |
| 420 | expectBufferColor(Rect(0, 0, DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2), 0, 0, 255, |
| 421 | 255); |
| 422 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, 0, DEFAULT_DISPLAY_WIDTH, |
| 423 | DEFAULT_DISPLAY_HEIGHT / 2), |
| 424 | 0, 0, 0, 0); |
| 425 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2, |
| 426 | DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT), |
| 427 | 0, 255, 0, 255); |
| 428 | expectBufferColor(Rect(0, DEFAULT_DISPLAY_HEIGHT / 2, DEFAULT_DISPLAY_WIDTH / 2, |
| 429 | DEFAULT_DISPLAY_HEIGHT), |
| 430 | 255, 0, 0, 255); |
| 431 | } |
| 432 | |
| 433 | template <typename SourceVariant> |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 434 | void RenderEngineTest::fillBufferWithLayerTransform() { |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 435 | renderengine::DisplaySettings settings; |
| 436 | settings.physicalDisplay = fullscreenRect(); |
| 437 | // Here logical space is 2x2 |
| 438 | settings.clip = Rect(2, 2); |
| 439 | |
| 440 | std::vector<renderengine::LayerSettings> layers; |
| 441 | |
| 442 | renderengine::LayerSettings layer; |
| 443 | layer.geometry.boundaries = Rect(1, 1).toFloatRect(); |
| 444 | // Translate one pixel diagonally |
| 445 | layer.geometry.positionTransform = mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 446 | SourceVariant::fillColor(layer, 1.0f, 0.0f, 0.0f, this); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 447 | layer.source.solidColor = half3(1.0f, 0.0f, 0.0f); |
| 448 | layer.alpha = 1.0f; |
| 449 | |
| 450 | layers.push_back(layer); |
| 451 | |
| 452 | invokeDraw(settings, layers, mBuffer); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 453 | } |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 454 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 455 | template <typename SourceVariant> |
| 456 | void RenderEngineTest::fillBufferLayerTransform() { |
| 457 | fillBufferWithLayerTransform<SourceVariant>(); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 458 | expectBufferColor(Rect(0, 0, DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT / 2), 0, 0, 0, 0); |
| 459 | expectBufferColor(Rect(0, 0, DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT), 0, 0, 0, 0); |
| 460 | expectBufferColor(Rect(DEFAULT_DISPLAY_WIDTH / 2, DEFAULT_DISPLAY_HEIGHT / 2, |
| 461 | DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT), |
| 462 | 255, 0, 0, 255); |
| 463 | } |
| 464 | |
| 465 | template <typename SourceVariant> |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 466 | void RenderEngineTest::fillBufferWithColorTransform() { |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 467 | renderengine::DisplaySettings settings; |
| 468 | settings.physicalDisplay = fullscreenRect(); |
| 469 | settings.clip = Rect(1, 1); |
| 470 | |
| 471 | std::vector<renderengine::LayerSettings> layers; |
| 472 | |
| 473 | renderengine::LayerSettings layer; |
| 474 | layer.geometry.boundaries = Rect(1, 1).toFloatRect(); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 475 | SourceVariant::fillColor(layer, 0.5f, 0.25f, 0.125f, this); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 476 | layer.alpha = 1.0f; |
| 477 | |
| 478 | // construct a fake color matrix |
| 479 | // annihilate green and blue channels |
| 480 | settings.colorTransform = mat4::scale(vec4(1, 0, 0, 1)); |
| 481 | // set red channel to red + green |
| 482 | layer.colorTransform = mat4(1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); |
| 483 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 484 | layer.alpha = 1.0f; |
| 485 | layer.geometry.boundaries = Rect(1, 1).toFloatRect(); |
| 486 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 487 | layers.push_back(layer); |
| 488 | |
| 489 | invokeDraw(settings, layers, mBuffer); |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 490 | } |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 491 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 492 | template <typename SourceVariant> |
| 493 | void RenderEngineTest::fillBufferColorTransform() { |
| 494 | fillBufferWithColorTransform<SourceVariant>(); |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 495 | expectBufferColor(fullscreenRect(), 191, 0, 0, 255); |
| 496 | } |
| 497 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 498 | void RenderEngineTest::fillRedBufferTextureTransform() { |
| 499 | renderengine::DisplaySettings settings; |
| 500 | settings.physicalDisplay = fullscreenRect(); |
| 501 | settings.clip = Rect(1, 1); |
| 502 | |
| 503 | std::vector<renderengine::LayerSettings> layers; |
| 504 | |
| 505 | renderengine::LayerSettings layer; |
| 506 | // Here will allocate a checker board texture, but transform texture |
| 507 | // coordinates so that only the upper left is applied. |
| 508 | sp<GraphicBuffer> buf = allocateSourceBuffer(2, 2); |
| 509 | uint32_t texName; |
| 510 | RenderEngineTest::sRE->genTextures(1, &texName); |
| 511 | this->mTexNames.push_back(texName); |
| 512 | |
| 513 | uint8_t* pixels; |
| 514 | buf->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN, |
| 515 | reinterpret_cast<void**>(&pixels)); |
| 516 | // Red top left, Green top right, Blue bottom left, Black bottom right |
| 517 | pixels[0] = 255; |
| 518 | pixels[1] = 0; |
| 519 | pixels[2] = 0; |
| 520 | pixels[3] = 255; |
| 521 | pixels[4] = 0; |
| 522 | pixels[5] = 255; |
| 523 | pixels[6] = 0; |
| 524 | pixels[7] = 255; |
| 525 | pixels[8] = 0; |
| 526 | pixels[9] = 0; |
| 527 | pixels[10] = 255; |
| 528 | pixels[11] = 255; |
| 529 | buf->unlock(); |
| 530 | |
| 531 | layer.source.buffer.buffer = buf; |
| 532 | layer.source.buffer.textureName = texName; |
| 533 | // Transform coordinates to only be inside the red quadrant. |
| 534 | layer.source.buffer.textureTransform = mat4::scale(vec4(0.2, 0.2, 1, 1)); |
| 535 | layer.alpha = 1.0f; |
| 536 | layer.geometry.boundaries = Rect(1, 1).toFloatRect(); |
| 537 | |
| 538 | layers.push_back(layer); |
| 539 | |
| 540 | invokeDraw(settings, layers, mBuffer); |
| 541 | } |
| 542 | |
| 543 | void RenderEngineTest::fillBufferTextureTransform() { |
| 544 | fillRedBufferTextureTransform(); |
| 545 | expectBufferColor(fullscreenRect(), 255, 0, 0, 255); |
| 546 | } |
| 547 | |
| 548 | void RenderEngineTest::fillRedBufferWithPremultiplyAlpha() { |
| 549 | renderengine::DisplaySettings settings; |
| 550 | settings.physicalDisplay = fullscreenRect(); |
| 551 | // Here logical space is 1x1 |
| 552 | settings.clip = Rect(1, 1); |
| 553 | |
| 554 | std::vector<renderengine::LayerSettings> layers; |
| 555 | |
| 556 | renderengine::LayerSettings layer; |
| 557 | sp<GraphicBuffer> buf = allocateSourceBuffer(1, 1); |
| 558 | uint32_t texName; |
| 559 | RenderEngineTest::sRE->genTextures(1, &texName); |
| 560 | this->mTexNames.push_back(texName); |
| 561 | |
| 562 | uint8_t* pixels; |
| 563 | buf->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN, |
| 564 | reinterpret_cast<void**>(&pixels)); |
| 565 | pixels[0] = 255; |
| 566 | pixels[1] = 0; |
| 567 | pixels[2] = 0; |
| 568 | pixels[3] = 255; |
| 569 | buf->unlock(); |
| 570 | |
| 571 | layer.source.buffer.buffer = buf; |
| 572 | layer.source.buffer.textureName = texName; |
| 573 | layer.source.buffer.usePremultipliedAlpha = true; |
| 574 | layer.alpha = 0.5f; |
| 575 | layer.geometry.boundaries = Rect(1, 1).toFloatRect(); |
| 576 | |
| 577 | layers.push_back(layer); |
| 578 | |
| 579 | invokeDraw(settings, layers, mBuffer); |
| 580 | } |
| 581 | |
| 582 | void RenderEngineTest::fillBufferWithPremultiplyAlpha() { |
| 583 | fillRedBufferWithPremultiplyAlpha(); |
| 584 | expectBufferColor(fullscreenRect(), 128, 0, 0, 128); |
| 585 | } |
| 586 | |
| 587 | void RenderEngineTest::fillRedBufferWithoutPremultiplyAlpha() { |
| 588 | renderengine::DisplaySettings settings; |
| 589 | settings.physicalDisplay = fullscreenRect(); |
| 590 | // Here logical space is 1x1 |
| 591 | settings.clip = Rect(1, 1); |
| 592 | |
| 593 | std::vector<renderengine::LayerSettings> layers; |
| 594 | |
| 595 | renderengine::LayerSettings layer; |
| 596 | sp<GraphicBuffer> buf = allocateSourceBuffer(1, 1); |
| 597 | uint32_t texName; |
| 598 | RenderEngineTest::sRE->genTextures(1, &texName); |
| 599 | this->mTexNames.push_back(texName); |
| 600 | |
| 601 | uint8_t* pixels; |
| 602 | buf->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN, |
| 603 | reinterpret_cast<void**>(&pixels)); |
| 604 | pixels[0] = 255; |
| 605 | pixels[1] = 0; |
| 606 | pixels[2] = 0; |
| 607 | pixels[3] = 255; |
| 608 | buf->unlock(); |
| 609 | |
| 610 | layer.source.buffer.buffer = buf; |
| 611 | layer.source.buffer.textureName = texName; |
| 612 | layer.source.buffer.usePremultipliedAlpha = false; |
| 613 | layer.alpha = 0.5f; |
| 614 | layer.geometry.boundaries = Rect(1, 1).toFloatRect(); |
| 615 | |
| 616 | layers.push_back(layer); |
| 617 | |
| 618 | invokeDraw(settings, layers, mBuffer); |
| 619 | } |
| 620 | |
| 621 | void RenderEngineTest::fillBufferWithoutPremultiplyAlpha() { |
| 622 | fillRedBufferWithoutPremultiplyAlpha(); |
| 623 | expectBufferColor(fullscreenRect(), 128, 0, 0, 64, 1); |
| 624 | } |
| 625 | |
Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 626 | TEST_F(RenderEngineTest, drawLayers_noLayersToDraw) { |
| 627 | drawEmptyLayers(); |
| 628 | } |
| 629 | |
| 630 | TEST_F(RenderEngineTest, drawLayers_fillRedBuffer_colorSource) { |
| 631 | fillRedBuffer<ColorSourceVariant>(); |
| 632 | } |
| 633 | |
| 634 | TEST_F(RenderEngineTest, drawLayers_fillGreenBuffer_colorSource) { |
| 635 | fillGreenBuffer<ColorSourceVariant>(); |
| 636 | } |
| 637 | |
| 638 | TEST_F(RenderEngineTest, drawLayers_fillBlueBuffer_colorSource) { |
| 639 | fillBlueBuffer<ColorSourceVariant>(); |
| 640 | } |
| 641 | |
| 642 | TEST_F(RenderEngineTest, drawLayers_fillRedTransparentBuffer_colorSource) { |
| 643 | fillRedTransparentBuffer<ColorSourceVariant>(); |
| 644 | } |
| 645 | |
| 646 | TEST_F(RenderEngineTest, drawLayers_fillBufferPhysicalOffset_colorSource) { |
| 647 | fillBufferPhysicalOffset<ColorSourceVariant>(); |
| 648 | } |
| 649 | |
| 650 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate0_colorSource) { |
| 651 | fillBufferCheckersRotate0<ColorSourceVariant>(); |
| 652 | } |
| 653 | |
| 654 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate90_colorSource) { |
| 655 | fillBufferCheckersRotate90<ColorSourceVariant>(); |
| 656 | } |
| 657 | |
| 658 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate180_colorSource) { |
| 659 | fillBufferCheckersRotate180<ColorSourceVariant>(); |
| 660 | } |
| 661 | |
| 662 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate270_colorSource) { |
| 663 | fillBufferCheckersRotate270<ColorSourceVariant>(); |
| 664 | } |
| 665 | |
| 666 | TEST_F(RenderEngineTest, drawLayers_fillBufferLayerTransform_colorSource) { |
| 667 | fillBufferLayerTransform<ColorSourceVariant>(); |
| 668 | } |
| 669 | |
| 670 | TEST_F(RenderEngineTest, drawLayers_fillBufferColorTransform_colorSource) { |
| 671 | fillBufferLayerTransform<ColorSourceVariant>(); |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 672 | } |
| 673 | |
Alec Mouri | 0d5e1eb | 2018-11-10 20:40:12 -0800 | [diff] [blame] | 674 | TEST_F(RenderEngineTest, drawLayers_fillRedBuffer_opaqueBufferSource) { |
| 675 | fillRedBuffer<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 676 | } |
| 677 | |
| 678 | TEST_F(RenderEngineTest, drawLayers_fillGreenBuffer_opaqueBufferSource) { |
| 679 | fillGreenBuffer<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 680 | } |
| 681 | |
| 682 | TEST_F(RenderEngineTest, drawLayers_fillBlueBuffer_opaqueBufferSource) { |
| 683 | fillBlueBuffer<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 684 | } |
| 685 | |
| 686 | TEST_F(RenderEngineTest, drawLayers_fillRedTransparentBuffer_opaqueBufferSource) { |
| 687 | fillRedTransparentBuffer<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 688 | } |
| 689 | |
| 690 | TEST_F(RenderEngineTest, drawLayers_fillBufferPhysicalOffset_opaqueBufferSource) { |
| 691 | fillBufferPhysicalOffset<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 692 | } |
| 693 | |
| 694 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate0_opaqueBufferSource) { |
| 695 | fillBufferCheckersRotate0<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 696 | } |
| 697 | |
| 698 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate90_opaqueBufferSource) { |
| 699 | fillBufferCheckersRotate90<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 700 | } |
| 701 | |
| 702 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate180_opaqueBufferSource) { |
| 703 | fillBufferCheckersRotate180<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 704 | } |
| 705 | |
| 706 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate270_opaqueBufferSource) { |
| 707 | fillBufferCheckersRotate270<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 708 | } |
| 709 | |
| 710 | TEST_F(RenderEngineTest, drawLayers_fillBufferLayerTransform_opaqueBufferSource) { |
| 711 | fillBufferLayerTransform<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 712 | } |
| 713 | |
| 714 | TEST_F(RenderEngineTest, drawLayers_fillBufferColorTransform_opaqueBufferSource) { |
| 715 | fillBufferLayerTransform<BufferSourceVariant<ForceOpaqueBufferVariant>>(); |
| 716 | } |
| 717 | |
| 718 | TEST_F(RenderEngineTest, drawLayers_fillRedBuffer_bufferSource) { |
| 719 | fillRedBuffer<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 720 | } |
| 721 | |
| 722 | TEST_F(RenderEngineTest, drawLayers_fillGreenBuffer_bufferSource) { |
| 723 | fillGreenBuffer<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 724 | } |
| 725 | |
| 726 | TEST_F(RenderEngineTest, drawLayers_fillBlueBuffer_bufferSource) { |
| 727 | fillBlueBuffer<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 728 | } |
| 729 | |
| 730 | TEST_F(RenderEngineTest, drawLayers_fillRedTransparentBuffer_bufferSource) { |
| 731 | fillRedTransparentBuffer<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 732 | } |
| 733 | |
| 734 | TEST_F(RenderEngineTest, drawLayers_fillBufferPhysicalOffset_bufferSource) { |
| 735 | fillBufferPhysicalOffset<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 736 | } |
| 737 | |
| 738 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate0_bufferSource) { |
| 739 | fillBufferCheckersRotate0<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 740 | } |
| 741 | |
| 742 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate90_bufferSource) { |
| 743 | fillBufferCheckersRotate90<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 744 | } |
| 745 | |
| 746 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate180_bufferSource) { |
| 747 | fillBufferCheckersRotate180<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 748 | } |
| 749 | |
| 750 | TEST_F(RenderEngineTest, drawLayers_fillBufferCheckersRotate270_bufferSource) { |
| 751 | fillBufferCheckersRotate270<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 752 | } |
| 753 | |
| 754 | TEST_F(RenderEngineTest, drawLayers_fillBufferLayerTransform_bufferSource) { |
| 755 | fillBufferLayerTransform<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 756 | } |
| 757 | |
| 758 | TEST_F(RenderEngineTest, drawLayers_fillBufferColorTransform_bufferSource) { |
| 759 | fillBufferLayerTransform<BufferSourceVariant<RelaxOpaqueBufferVariant>>(); |
| 760 | } |
| 761 | |
| 762 | TEST_F(RenderEngineTest, drawLayers_fillBufferTextureTransform) { |
| 763 | fillBufferTextureTransform(); |
| 764 | } |
| 765 | |
| 766 | TEST_F(RenderEngineTest, drawLayers_fillBuffer_premultipliesAlpha) { |
| 767 | fillBufferWithPremultiplyAlpha(); |
| 768 | } |
| 769 | |
| 770 | TEST_F(RenderEngineTest, drawLayers_fillBuffer_withoutPremultiplyingAlpha) { |
| 771 | fillBufferWithoutPremultiplyAlpha(); |
| 772 | } |
| 773 | |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 774 | } // namespace android |