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

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: 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
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();
+}
Daniele Castagna 2016/05/09 23:34:19 Is has_external_content true? Can you check the al
reveman 2016/05/10 14:05:19 has_external_content is true independent of this.
+
TEST_F(SurfaceTest, Commit) {
std::unique_ptr<Surface> surface(new Surface);

Powered by Google App Engine
This is Rietveld 408576698