Index: ui/aura/root_window.cc |
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc |
index 48a202e97188b8275a0270bdff8d2093123c916f..c1323c08c08267eaa899fa4738c8433f948af68d 100644 |
--- a/ui/aura/root_window.cc |
+++ b/ui/aura/root_window.cc |
@@ -33,6 +33,8 @@ |
#include "ui/gfx/monitor.h" |
#include "ui/gfx/screen.h" |
+#include "ui/compositor/layer_type.h" |
+ |
using std::vector; |
namespace aura { |
@@ -127,6 +129,7 @@ RootWindow::RootWindow(const gfx::Rect& initial_bounds) |
defer_draw_scheduling_(false), |
mouse_move_hold_count_(0), |
should_hold_mouse_moves_(false), |
+ force_hide_cursor_(false), |
compositor_lock_(NULL), |
draw_on_compositor_unlock_(false), |
draw_trace_count_(0) { |
@@ -164,7 +167,15 @@ void RootWindow::Init() { |
Window::Init(ui::LAYER_NOT_DRAWN); |
last_mouse_location_ = |
ui::ConvertPointToDIP(layer(), host_->QueryMouseLocation()); |
- compositor()->SetRootLayer(layer()); |
+ |
+ magnification_layer_.reset(new ui::Layer(ui::LAYER_TEXTURED)); |
+ magnification_layer_->SetVisible(false); |
+ magnification_layer_->SetFillsBoundsOpaquely(true); |
+ magnification_layer_->Add(layer()); |
+ magnification_layer_->SetVisible(true); |
+ |
+ compositor()->SetRootLayer(magnification_layer_.get()); |
+ |
SetBounds( |
ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size()))); |
Show(); |
@@ -211,6 +222,9 @@ void RootWindow::SetCursor(gfx::NativeCursor cursor) { |
} |
void RootWindow::ShowCursor(bool show) { |
+ if (force_hide_cursor_ && show) |
+ show = false; |
+ |
cursor_shown_ = show; |
host_->ShowCursor(show); |
} |
@@ -309,6 +323,10 @@ bool RootWindow::DispatchScrollEvent(ScrollEvent* event) { |
bool RootWindow::DispatchTouchEvent(TouchEvent* event) { |
DispatchHeldMouseMove(); |
+ |
+ // Touch event should be transformed by magnifition transform matrix. |
+ event->UpdateForRootTransform(magnification_layer()->transform()); |
sky
2012/05/16 15:40:48
Why wouldn't it effect mouse or gesture events?
yoshiki
2012/05/17 17:19:32
This CL magnifies the screen with |magnification_l
|
+ |
if (ui::IsDIPEnabled()) { |
float scale = ui::GetDeviceScaleFactor(layer()); |
ui::Transform transform = layer()->transform(); |