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

Unified Diff: ui/compositor/layer.cc

Issue 2286123002: ui: Remove unused Layer API. (Closed)
Patch Set: Created 4 years, 4 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 | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index e8e79d2156c33adb73bf16a50dcbafa04469725c..c7111526207124f5ba5b647301a49742c2bc4ea9 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -67,9 +67,7 @@ Layer::Layer()
delegate_(NULL),
owner_(NULL),
cc_layer_(NULL),
- device_scale_factor_(1.0f),
- texture_x_scale_(1.0f),
- texture_y_scale_(1.0f) {
+ device_scale_factor_(1.0f) {
CreateCcLayer();
}
@@ -92,9 +90,7 @@ Layer::Layer(LayerType type)
delegate_(NULL),
owner_(NULL),
cc_layer_(NULL),
- device_scale_factor_(1.0f),
- texture_x_scale_(1.0f),
- texture_y_scale_(1.0f) {
+ device_scale_factor_(1.0f) {
CreateCcLayer();
}
@@ -571,24 +567,6 @@ bool Layer::TextureFlipped() const {
return texture_layer_->flipped();
}
-void Layer::SetTextureAlpha(float alpha) {
- DCHECK(texture_layer_.get());
- texture_layer_->SetVertexOpacity(alpha, alpha, alpha, alpha);
-}
-
-void Layer::SetTextureCrop(const gfx::RectF& crop) {
- DCHECK(texture_layer_.get());
- texture_crop_ = crop;
- RecomputeDrawsContentAndUVRect();
-}
-
-void Layer::SetTextureScale(float x_scale, float y_scale) {
- DCHECK(texture_layer_.get());
- texture_x_scale_ = x_scale;
- texture_y_scale_ = y_scale;
- RecomputeDrawsContentAndUVRect();
-}
-
void Layer::SetShowSurface(
const cc::SurfaceId& surface_id,
const cc::SurfaceLayer::SatisfyCallback& satisfy_callback,
@@ -1046,21 +1024,9 @@ void Layer::RecomputeDrawsContentAndUVRect() {
if (texture_layer_.get()) {
size.SetToMin(frame_size_in_dip_);
gfx::PointF uv_top_left(0.f, 0.f);
- gfx::PointF uv_bottom_right(1.f, 1.f);
- if (!texture_crop_.IsEmpty()) {
- uv_top_left = texture_crop_.origin();
- uv_top_left.Scale(1.f / frame_size_in_dip_.width(),
- 1.f / frame_size_in_dip_.height());
- uv_bottom_right = texture_crop_.bottom_right();
- uv_bottom_right.Scale(1.f / frame_size_in_dip_.width(),
- 1.f / frame_size_in_dip_.height());
- }
- float x_scale = texture_x_scale_ * static_cast<float>(size.width()) /
- frame_size_in_dip_.width();
- float y_scale = texture_y_scale_ * static_cast<float>(size.height()) /
- frame_size_in_dip_.height();
- uv_top_left.Scale(x_scale, y_scale);
- uv_bottom_right.Scale(x_scale, y_scale);
+ gfx::PointF uv_bottom_right(
+ static_cast<float>(size.width()) / frame_size_in_dip_.width(),
+ static_cast<float>(size.height()) / frame_size_in_dip_.height());
texture_layer_->SetUV(uv_top_left, uv_bottom_right);
} else if (surface_layer_.get()) {
size.SetToMin(frame_size_in_dip_);
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698