Chromium Code Reviews| Index: ui/compositor/layer.cc |
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
| index 67d4ca7e90abbf4ea78c6fa3be5f0c66d94f0339..d8e130f26a692f21af1b907a83059da7bd8d616a 100644 |
| --- a/ui/compositor/layer.cc |
| +++ b/ui/compositor/layer.cc |
| @@ -60,6 +60,9 @@ Layer::Layer() |
| layer_inverted_(false), |
| layer_mask_(NULL), |
| layer_mask_back_link_(NULL), |
| + zoom_x_offset_(0), |
| + zoom_y_offset_(0), |
| + zoom_(1), |
| delegate_(NULL), |
| web_layer_(NULL), |
| scale_content_(true), |
| @@ -83,6 +86,9 @@ Layer::Layer(LayerType type) |
| layer_inverted_(false), |
| layer_mask_(NULL), |
| layer_mask_back_link_(NULL), |
| + zoom_x_offset_(0), |
| + zoom_y_offset_(0), |
| + zoom_(1), |
| delegate_(NULL), |
| scale_content_(true), |
| device_scale_factor_(1.0f) { |
| @@ -294,6 +300,21 @@ void Layer::SetMaskLayer(Layer* layer_mask) { |
| layer_mask->layer_mask_back_link_ = this; |
| } |
| +void Layer::SetBackgroundZoom(float x_offset, float y_offset, float zoom) { |
| + zoom_x_offset_ = x_offset; |
|
sky
2012/09/07 16:06:59
These values aren't used locally, only passed to w
Zachary Kuznia
2012/09/13 11:49:02
Done.
|
| + zoom_y_offset_ = y_offset; |
| + zoom_ = zoom; |
| + |
| + WebKit::WebFilterOperations filters; |
| + if (zoom_ != 1) { |
| + filters.append(WebKit::WebFilterOperation::createZoomFilter( |
| + WebKit::WebRect(zoom_x_offset_, zoom_y_offset_, |
| + (bounds().width() / zoom_), |
|
piman
2012/09/07 21:38:56
is bounds() what you want, if the layer is animate
Zachary Kuznia
2012/09/13 11:49:02
Done.
|
| + (bounds().height() / zoom_)), 16)); |
|
piman
2012/09/07 21:38:56
16 looks very magic. Should it be passed as a para
Zachary Kuznia
2012/09/13 11:49:02
Done.
|
| + } |
| + web_layer_->setBackgroundFilters(filters); |
|
piman
2012/09/07 21:38:56
This overrides the SetBackgroundBlur setting and v
Zachary Kuznia
2012/09/13 11:49:02
Done.
|
| +} |
| + |
| void Layer::SetLayerFilters() { |
| WebKit::WebFilterOperations filters; |
| if (layer_saturation_) { |