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

Unified Diff: components/exo/surface.cc

Issue 2046493005: exo: Implement Surface::SetSurfaceLayerContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | 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 30b783aaf09b9359be9173268d0f6ca0935a566c..2c824c3fe2d06a1715bc98ec5f56405abdaae061 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -881,8 +881,17 @@ void Surface::SetTextureLayerContents(ui::Layer* layer) {
}
void Surface::SetSurfaceLayerContents(ui::Layer* layer) {
- // TODO(jbauman): Implement this.
- NOTIMPLEMENTED();
+ if (surface_id_.is_null())
+ return;
+
+ gfx::Size layer_size = layer->bounds().size();
+ float contents_surface_to_layer_scale = 1.0f;
+
+ layer->SetShowSurface(
+ surface_id_,
+ base::Bind(&SatisfyCallback, base::Unretained(surface_manager_)),
+ base::Bind(&RequireCallback, base::Unretained(surface_manager_)),
+ layer_size, contents_surface_to_layer_scale, layer_size);
}
bool Surface::use_surface_layer_ = false;
« no previous file with comments | « no previous file | components/exo/surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698