Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: components/exo/surface_unittest.cc

Issue 1962473002: exo: Add support for alpha_compositing interface to wayland bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wayland-protocols-alpha-compositing
Patch Set: address review feedback Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/surface.cc ('k') | components/exo/wayland/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface_unittest.cc
diff --git a/components/exo/surface_unittest.cc b/components/exo/surface_unittest.cc
index ed1834df38b82333a28c1ebc1ba0394d7e98118a..1795bca80de3ba4ea1ee36be75bfaa68e139c32f 100644
--- a/components/exo/surface_unittest.cc
+++ b/components/exo/surface_unittest.cc
@@ -153,6 +153,30 @@ TEST_F(SurfaceTest, SetOnlyVisibleOnSecureOutput) {
release_callback->Run(gpu::SyncToken(), false);
}
+TEST_F(SurfaceTest, SetBlendMode) {
+ gfx::Size buffer_size(1, 1);
+ std::unique_ptr<Buffer> buffer(
+ new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
+ std::unique_ptr<Surface> surface(new Surface);
+
+ surface->Attach(buffer.get());
+ surface->SetBlendMode(SkXfermode::kSrc_Mode);
+ surface->Commit();
+
+ EXPECT_TRUE(surface->layer()->fills_bounds_opaquely());
+}
+
+TEST_F(SurfaceTest, SetAlpha) {
+ gfx::Size buffer_size(1, 1);
+ std::unique_ptr<Buffer> buffer(
+ new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
+ std::unique_ptr<Surface> surface(new Surface);
+
+ surface->Attach(buffer.get());
+ surface->SetAlpha(0.5f);
+ surface->Commit();
+}
+
TEST_F(SurfaceTest, Commit) {
std::unique_ptr<Surface> surface(new Surface);
« no previous file with comments | « components/exo/surface.cc ('k') | components/exo/wayland/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698