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

Unified Diff: components/exo/surface.cc

Issue 1802993003: exo: Add support for secure_output interface to wayland bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wayland-protocols-secure-contents
Patch Set: improve unit test Created 4 years, 9 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.h ('k') | components/exo/surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index 23a554a67facc00edca55efdaf120e89313b9169..65be2201802fd127b7b6fb93527b184ecefe9d45 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -124,6 +124,7 @@ Surface::Surface()
has_pending_contents_(false),
pending_input_region_(SkIRect::MakeLargest()),
pending_buffer_scale_(1.0f),
+ pending_only_visible_on_secure_output_(false),
input_region_(SkIRect::MakeLargest()),
needs_commit_surface_hierarchy_(false),
update_contents_after_successful_compositing_(false),
@@ -295,6 +296,13 @@ void Surface::SetViewport(const gfx::Size& viewport) {
pending_viewport_ = viewport;
}
+void Surface::SetOnlyVisibleOnSecureOutput(bool only_visible_on_secure_output) {
+ TRACE_EVENT1("exo", "Surface::SetOnlyVisibleOnSecureOutput",
+ "only_visible_on_secure_output", only_visible_on_secure_output);
+
+ pending_only_visible_on_secure_output_ = only_visible_on_secure_output;
+}
+
void Surface::Commit() {
TRACE_EVENT0("exo", "Surface::Commit");
@@ -317,11 +325,17 @@ void Surface::CommitSurfaceHierarchy() {
current_buffer_ = pending_buffer_;
pending_buffer_.reset();
+ // TODO(dcastagna): Make secure_output_only a layer property instead of a
+ // texture mailbox flag so this can be changed without have to provide
+ // new contents.
+ bool secure_output_only = pending_only_visible_on_secure_output_;
+ pending_only_visible_on_secure_output_ = false;
+
cc::TextureMailbox texture_mailbox;
scoped_ptr<cc::SingleReleaseCallback> texture_mailbox_release_callback;
if (current_buffer_) {
- texture_mailbox_release_callback =
- current_buffer_->ProduceTextureMailbox(&texture_mailbox, false);
+ texture_mailbox_release_callback = current_buffer_->ProduceTextureMailbox(
+ &texture_mailbox, secure_output_only, false);
}
if (texture_mailbox_release_callback) {
@@ -497,10 +511,15 @@ void Surface::OnCompositingEnded(ui::Compositor* compositor) {
if (!current_buffer_)
return;
+ // TODO(dcastagna): Make secure_output_only a layer property instead of a
+ // texture mailbox flag.
+ bool secure_output_only = false;
+
// Update contents by producing a new texture mailbox for the current buffer.
cc::TextureMailbox texture_mailbox;
scoped_ptr<cc::SingleReleaseCallback> texture_mailbox_release_callback =
- current_buffer_->ProduceTextureMailbox(&texture_mailbox, true);
+ current_buffer_->ProduceTextureMailbox(&texture_mailbox,
+ secure_output_only, true);
if (texture_mailbox_release_callback) {
layer()->SetTextureMailbox(texture_mailbox,
std::move(texture_mailbox_release_callback),
« no previous file with comments | « components/exo/surface.h ('k') | components/exo/surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698