exo: Use buffer format to determine if content is opaque.
Detect when buffer format implicitly makes content opaque. This reduces
the amount of overdraw significantly for clients that are not explicitly
setting opaque region. E.g. Xwayland.
BUG=687187
TEST=chrome --show-overdraw-feedback
Review-Url: https://codereview.chromium.org/2662973004
Cr-Commit-Position: refs/heads/master@{#447347}
diff --git a/components/exo/surface.h b/components/exo/surface.h
index e50733e..14d7da0 100644
--- a/components/exo/surface.h
+++ b/components/exo/surface.h
@@ -361,6 +361,9 @@
// The last resource that was sent to a surface.
cc::TransferableResource current_resource_;
+ // Whether the last resource that was sent to a surface has an alpha channel.
+ bool current_resource_has_alpha_ = false;
+
// This is true if a call to Commit() as been made but
// CommitSurfaceHierarchy() has not yet been called.
bool needs_commit_surface_hierarchy_ = false;