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

Unified Diff: ui/compositor/layer.cc

Issue 10915140: Add the partial screen magnifier to Chrome OS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix preferences. Created 8 years, 3 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
« ash/magnifier/partial_magnification_controller.cc ('K') | « 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 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_) {
« ash/magnifier/partial_magnification_controller.cc ('K') | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698