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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/exo/surface_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/exo/surface.h" 5 #include "components/exo/surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 layer->SetTextureFlipped(false); 874 layer->SetTextureFlipped(false);
875 layer->SetTextureCrop(crop_); 875 layer->SetTextureCrop(crop_);
876 layer->SetTextureScale(static_cast<float>(texture_size_in_dip_.width()) / 876 layer->SetTextureScale(static_cast<float>(texture_size_in_dip_.width()) /
877 layer->bounds().width(), 877 layer->bounds().width(),
878 static_cast<float>(texture_size_in_dip_.height()) / 878 static_cast<float>(texture_size_in_dip_.height()) /
879 layer->bounds().height()); 879 layer->bounds().height());
880 layer->SetTextureAlpha(alpha_); 880 layer->SetTextureAlpha(alpha_);
881 } 881 }
882 882
883 void Surface::SetSurfaceLayerContents(ui::Layer* layer) { 883 void Surface::SetSurfaceLayerContents(ui::Layer* layer) {
884 // TODO(jbauman): Implement this. 884 if (surface_id_.is_null())
885 NOTIMPLEMENTED(); 885 return;
886
887 gfx::Size layer_size = layer->bounds().size();
888 float contents_surface_to_layer_scale = 1.0f;
889
890 layer->SetShowSurface(
891 surface_id_,
892 base::Bind(&SatisfyCallback, base::Unretained(surface_manager_)),
893 base::Bind(&RequireCallback, base::Unretained(surface_manager_)),
894 layer_size, contents_surface_to_layer_scale, layer_size);
886 } 895 }
887 896
888 bool Surface::use_surface_layer_ = false; 897 bool Surface::use_surface_layer_ = false;
889 898
890 } // namespace exo 899 } // namespace exo
OLDNEW
« 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