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

Side by Side Diff: ui/compositor/layer.cc

Issue 2654413002: Stretching NativeViewHost, and misc tab capture fixes.
Patch Set: Gettin' it all working on ui/cocoa and MacViews too. Created 3 years, 10 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 | « ui/compositor/layer.h ('k') | ui/views/controls/native/native_view_host.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 cc_layer_ = content_layer_.get(); 1109 cc_layer_ = content_layer_.get();
1110 } 1110 }
1111 cc_layer_->SetTransformOrigin(gfx::Point3F()); 1111 cc_layer_->SetTransformOrigin(gfx::Point3F());
1112 cc_layer_->SetContentsOpaque(true); 1112 cc_layer_->SetContentsOpaque(true);
1113 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN); 1113 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
1114 cc_layer_->SetLayerClient(this); 1114 cc_layer_->SetLayerClient(this);
1115 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id(), 0)); 1115 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id(), 0));
1116 RecomputePosition(); 1116 RecomputePosition();
1117 } 1117 }
1118 1118
1119 gfx::Transform Layer::transform() const {
1120 return cc_layer_->transform();
1121 }
1122
1123 void Layer::RecomputeDrawsContentAndUVRect() { 1119 void Layer::RecomputeDrawsContentAndUVRect() {
1124 DCHECK(cc_layer_); 1120 DCHECK(cc_layer_);
1125 gfx::Size size(bounds_.size()); 1121 gfx::Size size(bounds_.size());
1126 if (texture_layer_.get()) { 1122 if (texture_layer_.get()) {
1127 size.SetToMin(frame_size_in_dip_); 1123 size.SetToMin(frame_size_in_dip_);
1128 gfx::PointF uv_top_left(0.f, 0.f); 1124 gfx::PointF uv_top_left(0.f, 0.f);
1129 gfx::PointF uv_bottom_right( 1125 gfx::PointF uv_bottom_right(
1130 static_cast<float>(size.width()) / frame_size_in_dip_.width(), 1126 static_cast<float>(size.width()) / frame_size_in_dip_.width(),
1131 static_cast<float>(size.height()) / frame_size_in_dip_.height()); 1127 static_cast<float>(size.height()) / frame_size_in_dip_.height());
1132 texture_layer_->SetUV(uv_top_left, uv_bottom_right); 1128 texture_layer_->SetUV(uv_top_left, uv_bottom_right);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1168 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1173 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1169 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1174 return mirror_ptr.get() == mirror; 1170 return mirror_ptr.get() == mirror;
1175 }); 1171 });
1176 1172
1177 DCHECK(it != mirrors_.end()); 1173 DCHECK(it != mirrors_.end());
1178 mirrors_.erase(it); 1174 mirrors_.erase(it);
1179 } 1175 }
1180 1176
1181 } // namespace ui 1177 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/views/controls/native/native_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698