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

Side by Side Diff: ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc

Issue 262893002: Removes grab input window and extra grab and ungrab in X11WholeScreenMoveLoop Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removes grab input window and extra grab and ungrab in X11WholeScreenMoveLoop (null image case) Created 6 years, 7 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 | Annotate | Revision Log
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/views/widget/desktop_aura/x11_whole_screen_move_loop.h" 5 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h"
6 6
7 #include <X11/extensions/XInput2.h>
7 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. 9 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
9 #undef RootWindow 10 #undef RootWindow
10 11
11 #include "base/bind.h" 12 #include "base/bind.h"
12 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
13 #include "base/run_loop.h" 14 #include "base/run_loop.h"
14 #include "third_party/skia/include/core/SkBitmap.h"
15 #include "ui/aura/env.h" 15 #include "ui/aura/env.h"
16 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
17 #include "ui/aura/window_event_dispatcher.h" 17 #include "ui/aura/window_event_dispatcher.h"
18 #include "ui/aura/window_tree_host.h"
19 #include "ui/base/x/x11_util.h" 18 #include "ui/base/x/x11_util.h"
20 #include "ui/events/event.h" 19 #include "ui/events/event.h"
21 #include "ui/events/event_utils.h" 20 #include "ui/events/event_utils.h"
22 #include "ui/events/keycodes/keyboard_code_conversion_x.h" 21 #include "ui/events/keycodes/keyboard_code_conversion_x.h"
23 #include "ui/events/platform/scoped_event_dispatcher.h" 22 #include "ui/events/platform/scoped_event_dispatcher.h"
24 #include "ui/events/platform/x11/x11_event_source.h" 23 #include "ui/events/platform/x11/x11_event_source.h"
25 #include "ui/gfx/point_conversions.h"
26 #include "ui/gfx/screen.h"
27 #include "ui/views/controls/image_view.h"
28 #include "ui/views/widget/widget.h"
29 24
30 namespace views { 25 namespace views {
31 26
32 namespace {
33
34 // The minimum alpha before we declare a pixel transparent when searching in
35 // our source image.
36 const uint32 kMinAlpha = 32;
37 const unsigned char kDragWidgetOpacity = 0xc0;
38
39 class ScopedCapturer {
40 public:
41 explicit ScopedCapturer(aura::WindowTreeHost* host)
42 : host_(host) {
43 host_->SetCapture();
44 }
45
46 ~ScopedCapturer() {
47 host_->ReleaseCapture();
48 }
49
50 private:
51 aura::WindowTreeHost* host_;
52
53 DISALLOW_COPY_AND_ASSIGN(ScopedCapturer);
54 };
55
56 } // namespace
57
58 X11WholeScreenMoveLoop::X11WholeScreenMoveLoop( 27 X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(
59 X11WholeScreenMoveLoopDelegate* delegate) 28 X11WholeScreenMoveLoopDelegate* delegate)
60 : delegate_(delegate), 29 : delegate_(delegate),
61 in_move_loop_(false), 30 in_move_loop_(false),
62 should_reset_mouse_flags_(false), 31 should_reset_mouse_flags_(false),
63 grab_input_window_(None),
64 canceled_(false), 32 canceled_(false),
65 weak_factory_(this) { 33 weak_factory_(this) {
66 last_xmotion_.type = LASTEvent; 34 last_xmotion_.type = LASTEvent;
67 } 35 }
68 36
69 X11WholeScreenMoveLoop::~X11WholeScreenMoveLoop() {} 37 X11WholeScreenMoveLoop::~X11WholeScreenMoveLoop() {}
70 38
71 void X11WholeScreenMoveLoop::DispatchMouseMovement() { 39 void X11WholeScreenMoveLoop::DispatchMouseMovement() {
72 if (!weak_factory_.HasWeakPtrs()) 40 if (!weak_factory_.HasWeakPtrs())
73 return; 41 return;
74 weak_factory_.InvalidateWeakPtrs(); 42 weak_factory_.InvalidateWeakPtrs();
75 DCHECK_EQ(MotionNotify, last_xmotion_.type); 43 DCHECK_EQ(MotionNotify, last_xmotion_.type);
76 delegate_->OnMouseMovement(&last_xmotion_); 44 delegate_->OnMouseMovement(&last_xmotion_);
77 last_xmotion_.type = LASTEvent; 45 last_xmotion_.type = LASTEvent;
78 } 46 }
79 47
80 //////////////////////////////////////////////////////////////////////////////// 48 ////////////////////////////////////////////////////////////////////////////////
81 // DesktopWindowTreeHostLinux, ui::PlatformEventDispatcher implementation: 49 // DesktopWindowTreeHostLinux, ui::PlatformEventDispatcher implementation:
82 50
83 bool X11WholeScreenMoveLoop::CanDispatchEvent(const ui::PlatformEvent& event) { 51 bool X11WholeScreenMoveLoop::CanDispatchEvent(const ui::PlatformEvent& event) {
84 return in_move_loop_; 52 NOTREACHED();
53 return true;
85 } 54 }
86 55
87 uint32_t X11WholeScreenMoveLoop::DispatchEvent(const ui::PlatformEvent& event) { 56 uint32_t X11WholeScreenMoveLoop::DispatchEvent(const ui::PlatformEvent& event) {
88 // This method processes all events for the grab_input_window_ as well as 57 // This method processes all mouse events for all windows while the move loop
89 // mouse events for all windows while the move loop is active - even before 58 // is active.
90 // the grab is granted by X. This allows mouse notification events that were
91 // sent after the capture was requested but before the capture was granted
92 // to be dispatched. It is especially important to process the mouse release
93 // event that should have stopped the drag even if that mouse release happened
94 // before the grab was granted.
95 if (!in_move_loop_) 59 if (!in_move_loop_)
96 return ui::POST_DISPATCH_PERFORM_DEFAULT; 60 return ui::POST_DISPATCH_PERFORM_DEFAULT;
97 XEvent* xev = event; 61 XEvent* xev = event;
98 62
99 // Note: the escape key is handled in the tab drag controller, which has 63 // Note: the escape key is handled in the tab drag controller, which has
100 // keyboard focus even though we took pointer grab. 64 // keyboard focus even though we took pointer grab.
101 switch (xev->type) { 65 switch (xev->type) {
102 case MotionNotify: { 66 case MotionNotify: {
103 if (drag_widget_.get()) {
104 gfx::Screen* screen = gfx::Screen::GetNativeScreen();
105 gfx::Point location = gfx::ToFlooredPoint(
106 screen->GetCursorScreenPoint() - drag_offset_);
107 drag_widget_->SetBounds(gfx::Rect(location, drag_image_.size()));
108 drag_widget_->StackAtTop();
109 }
110 last_xmotion_ = xev->xmotion; 67 last_xmotion_ = xev->xmotion;
111 if (!weak_factory_.HasWeakPtrs()) { 68 if (!weak_factory_.HasWeakPtrs()) {
112 // Post a task to dispatch mouse movement event when control returns to 69 // Post a task to dispatch mouse movement event when control returns to
113 // the message loop. This allows smoother dragging since the events are 70 // the message loop. This allows smoother dragging since the events are
114 // dispatched without waiting for the drag widget updates. 71 // dispatched without waiting for the drag widget updates.
115 base::MessageLoopForUI::current()->PostTask( 72 base::MessageLoopForUI::current()->PostTask(
116 FROM_HERE, 73 FROM_HERE,
117 base::Bind(&X11WholeScreenMoveLoop::DispatchMouseMovement, 74 base::Bind(&X11WholeScreenMoveLoop::DispatchMouseMovement,
118 weak_factory_.GetWeakPtr())); 75 weak_factory_.GetWeakPtr()));
119 } 76 }
120 return ui::POST_DISPATCH_NONE; 77 return ui::POST_DISPATCH_NONE;
121 } 78 }
122 case ButtonRelease: { 79 case ButtonRelease: {
123 if (xev->xbutton.button == Button1) { 80 if (xev->xbutton.button == Button1) {
124 // Assume that drags are being done with the left mouse button. Only 81 // Assume that drags are being done with the left mouse button. Only
125 // break the drag if the left mouse button was released. 82 // break the drag if the left mouse button was released.
126 DispatchMouseMovement(); 83 DispatchMouseMovement();
127 delegate_->OnMouseReleased(); 84 delegate_->OnMouseReleased();
128 } 85 }
129 return ui::POST_DISPATCH_NONE; 86 // default will end up releasing capture in Widget::OnMouseEvent().
pkotwicz 2014/05/12 16:04:29 Nit: default -> Default
varkha 2014/05/20 17:13:35 Done.
87 return ui::POST_DISPATCH_PERFORM_DEFAULT;
130 } 88 }
131 case KeyPress: { 89 case KeyPress: {
132 if (ui::KeyboardCodeFromXKeyEvent(xev) == ui::VKEY_ESCAPE) { 90 if (ui::KeyboardCodeFromXKeyEvent(xev) == ui::VKEY_ESCAPE) {
133 canceled_ = true; 91 canceled_ = true;
134 EndMoveLoop(); 92 EndMoveLoop();
pkotwicz 2014/05/12 16:04:29 Maybe comment that how capture is released is diff
varkha 2014/05/20 17:13:35 Done.
93 // After the move loop ends the capture will get released.
94 // When dragging browser tabs this will happen when the tab loses focus
95 // since either the dragged browser frame is getting destroyed (for
96 // dragging out into a new frame) or the focus gets moved back to the
97 // source browser (when trying to drag into another browser in which
98 // case the EscapeTracker will dispatch the KeyPress event).
99 // For drag and drop scenarios the capture is on the drag widget and
100 // will get lost when the drag widget is destroyed in
101 // DesktopDragDropClientAuraX11::OnMoveLoopEnded().
135 return ui::POST_DISPATCH_NONE; 102 return ui::POST_DISPATCH_NONE;
136 } 103 }
137 break; 104 break;
138 } 105 }
139 case GenericEvent: { 106 case GenericEvent: {
140 ui::EventType type = ui::EventTypeFromNative(xev); 107 ui::EventType type = ui::EventTypeFromNative(xev);
141 switch (type) { 108 switch (type) {
142 case ui::ET_MOUSE_MOVED: 109 case ui::ET_MOUSE_MOVED:
143 case ui::ET_MOUSE_DRAGGED: 110 case ui::ET_MOUSE_DRAGGED:
144 case ui::ET_MOUSE_RELEASED: { 111 case ui::ET_MOUSE_RELEASED: {
145 XEvent xevent = {0}; 112 XEvent xevent = {0};
146 if (type == ui::ET_MOUSE_RELEASED) { 113 if (type == ui::ET_MOUSE_RELEASED) {
147 xevent.type = ButtonRelease; 114 xevent.type = ButtonRelease;
148 xevent.xbutton.button = ui::EventButtonFromNative(xev); 115 xevent.xbutton.button = ui::EventButtonFromNative(xev);
149 } else { 116 } else {
150 xevent.type = MotionNotify; 117 xevent.type = MotionNotify;
151 } 118 }
152 xevent.xany.display = xev->xgeneric.display; 119 xevent.xany.display = xev->xgeneric.display;
153 xevent.xany.window = grab_input_window_; 120 XIDeviceEvent* xievent =
121 static_cast<XIDeviceEvent*>(xev->xcookie.data);
122 xevent.xany.window = xievent->event;
154 // The fields used below are in the same place for all of events 123 // The fields used below are in the same place for all of events
155 // above. Using xmotion from XEvent's unions to avoid repeating 124 // above. Using xmotion from XEvent's unions to avoid repeating
156 // the code. 125 // the code.
157 xevent.xmotion.root = DefaultRootWindow(xev->xgeneric.display); 126 xevent.xmotion.root = DefaultRootWindow(xev->xgeneric.display);
158 xevent.xmotion.time = ui::EventTimeFromNative(xev).InMilliseconds(); 127 xevent.xmotion.time = ui::EventTimeFromNative(xev).InMilliseconds();
159 gfx::Point point(ui::EventSystemLocationFromNative(xev)); 128 gfx::Point point(ui::EventSystemLocationFromNative(xev));
160 xevent.xmotion.x_root = point.x(); 129 xevent.xmotion.x_root = point.x();
161 xevent.xmotion.y_root = point.y(); 130 xevent.xmotion.y_root = point.y();
162 DispatchEvent(&xevent); 131 return DispatchEvent(&xevent);
163 return ui::POST_DISPATCH_NONE;
164 } 132 }
165 default: 133 default:
166 break; 134 break;
167 } 135 }
168 } 136 }
169 } 137 }
170 138
171 return (event->xany.window == grab_input_window_) ? 139 return ui::POST_DISPATCH_PERFORM_DEFAULT;
172 ui::POST_DISPATCH_NONE : ui::POST_DISPATCH_PERFORM_DEFAULT;
173 } 140 }
174 141
175 bool X11WholeScreenMoveLoop::RunMoveLoop(aura::Window* source, 142 bool X11WholeScreenMoveLoop::RunMoveLoop() {
176 gfx::NativeCursor cursor) {
177 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. 143 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time.
178 144
179 // Start a capture on the host, so that it continues to receive events during
180 // the drag. This may be second time we are capturing the mouse events - the
181 // first being when a mouse is first pressed. That first capture needs to be
182 // released before the call to GrabPointerAndKeyboard below, otherwise it may
183 // get released while we still need the pointer grab, which is why we restrict
184 // the scope here.
185 {
186 ScopedCapturer capturer(source->GetHost());
187
188 grab_input_window_ = CreateDragInputWindow(gfx::GetXDisplay());
189 // Releasing ScopedCapturer ensures that any other instance of
190 // X11ScopedCapture will not prematurely release grab that will be acquired
191 // below.
192 }
193 // TODO(varkha): Consider integrating GrabPointerAndKeyboard with
194 // ScopedCapturer to avoid possibility of logically keeping multiple grabs.
195 if (!GrabPointerAndKeyboard(cursor)) {
196 XDestroyWindow(gfx::GetXDisplay(), grab_input_window_);
197 return false;
198 }
199
200 scoped_ptr<ui::ScopedEventDispatcher> old_dispatcher = 145 scoped_ptr<ui::ScopedEventDispatcher> old_dispatcher =
201 nested_dispatcher_.Pass(); 146 nested_dispatcher_.Pass();
202 nested_dispatcher_ = 147 nested_dispatcher_ =
203 ui::PlatformEventSource::GetInstance()->OverrideDispatcher(this); 148 ui::PlatformEventSource::GetInstance()->OverrideDispatcher(this);
pkotwicz 2014/05/12 16:04:29 Nit: might as well fix the alignment here
varkha 2014/05/20 17:13:35 Done.
204 if (!drag_image_.isNull() && CheckIfIconValid())
205 CreateDragImageWindow();
206 149
207 // We are handling a mouse drag outside of the aura::RootWindow system. We 150 // We are handling a mouse drag outside of the aura::RootWindow system. We
208 // must manually make aura think that the mouse button is pressed so that we 151 // must manually make aura think that the mouse button is pressed so that we
209 // don't draw extraneous tooltips. 152 // don't draw extraneous tooltips.
210 aura::Env* env = aura::Env::GetInstance(); 153 aura::Env* env = aura::Env::GetInstance();
211 if (!env->IsMouseButtonDown()) { 154 if (!env->IsMouseButtonDown()) {
212 env->set_mouse_button_flags(ui::EF_LEFT_MOUSE_BUTTON); 155 env->set_mouse_button_flags(ui::EF_LEFT_MOUSE_BUTTON);
213 should_reset_mouse_flags_ = true; 156 should_reset_mouse_flags_ = true;
214 } 157 }
215 158
216 in_move_loop_ = true; 159 in_move_loop_ = true;
217 canceled_ = false; 160 canceled_ = false;
218 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); 161 base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
219 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); 162 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop);
220 base::RunLoop run_loop; 163 base::RunLoop run_loop;
221 quit_closure_ = run_loop.QuitClosure(); 164 quit_closure_ = run_loop.QuitClosure();
222 run_loop.Run(); 165 run_loop.Run();
223 nested_dispatcher_ = old_dispatcher.Pass(); 166 nested_dispatcher_ = old_dispatcher.Pass();
224 return !canceled_; 167 return !canceled_;
225 } 168 }
226 169
227 void X11WholeScreenMoveLoop::UpdateCursor(gfx::NativeCursor cursor) {
228 if (in_move_loop_) {
229 // If we're still in the move loop, regrab the pointer with the updated
230 // cursor. Note: we can be called from handling an XdndStatus message after
231 // EndMoveLoop() was called, but before we return from the nested RunLoop.
232 GrabPointerAndKeyboard(cursor);
233 }
234 }
235
236 void X11WholeScreenMoveLoop::EndMoveLoop() { 170 void X11WholeScreenMoveLoop::EndMoveLoop() {
237 if (!in_move_loop_) 171 if (!in_move_loop_)
238 return; 172 return;
239 173
240 // Prevent DispatchMouseMovement from dispatching any posted motion event. 174 // Prevent DispatchMouseMovement from dispatching any posted motion event.
241 weak_factory_.InvalidateWeakPtrs(); 175 weak_factory_.InvalidateWeakPtrs();
242 last_xmotion_.type = LASTEvent; 176 last_xmotion_.type = LASTEvent;
243 177
244 // We undo our emulated mouse click from RunMoveLoop(); 178 // We undo our emulated mouse click from RunMoveLoop();
245 if (should_reset_mouse_flags_) { 179 if (should_reset_mouse_flags_) {
246 aura::Env::GetInstance()->set_mouse_button_flags(0); 180 aura::Env::GetInstance()->set_mouse_button_flags(0);
247 should_reset_mouse_flags_ = false; 181 should_reset_mouse_flags_ = false;
248 } 182 }
249 183
250 // TODO(erg): Is this ungrab the cause of having to click to give input focus
251 // on drawn out windows? Not ungrabbing here screws the X server until I kill
252 // the chrome process.
253
254 // Ungrab before we let go of the window.
255 XDisplay* display = gfx::GetXDisplay();
256 XUngrabPointer(display, CurrentTime);
257 XUngrabKeyboard(display, CurrentTime);
258
259 // Restore the previous dispatcher. 184 // Restore the previous dispatcher.
260 nested_dispatcher_.reset(); 185 nested_dispatcher_.reset();
261 drag_widget_.reset();
262 delegate_->OnMoveLoopEnded(); 186 delegate_->OnMoveLoopEnded();
263 XDestroyWindow(display, grab_input_window_);
264 grab_input_window_ = None;
265 187
266 in_move_loop_ = false; 188 in_move_loop_ = false;
267 quit_closure_.Run(); 189 quit_closure_.Run();
268 } 190 }
269 191
270 void X11WholeScreenMoveLoop::SetDragImage(const gfx::ImageSkia& image,
271 gfx::Vector2dF offset) {
272 drag_image_ = image;
273 drag_offset_ = offset;
274 // Reset the Y offset, so that the drag-image is always just below the cursor,
275 // so that it is possible to see where the cursor is going.
276 drag_offset_.set_y(0.f);
277 }
278
279 bool X11WholeScreenMoveLoop::GrabPointerAndKeyboard(gfx::NativeCursor cursor) {
280 XDisplay* display = gfx::GetXDisplay();
281 XGrabServer(display);
282
283 XUngrabPointer(display, CurrentTime);
284 int ret = XGrabPointer(
285 display,
286 grab_input_window_,
287 False,
288 ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
289 GrabModeAsync,
290 GrabModeAsync,
291 None,
292 cursor.platform(),
293 CurrentTime);
294 if (ret != GrabSuccess) {
295 DLOG(ERROR) << "Grabbing pointer for dragging failed: "
296 << ui::GetX11ErrorString(display, ret);
297 } else {
298 XUngrabKeyboard(display, CurrentTime);
299 ret = XGrabKeyboard(
300 display,
301 grab_input_window_,
302 False,
303 GrabModeAsync,
304 GrabModeAsync,
305 CurrentTime);
306 if (ret != GrabSuccess) {
307 DLOG(ERROR) << "Grabbing keyboard for dragging failed: "
308 << ui::GetX11ErrorString(display, ret);
309 }
310 }
311
312 XUngrabServer(display);
313 XFlush(display);
314 return ret == GrabSuccess;
315 }
316
317 Window X11WholeScreenMoveLoop::CreateDragInputWindow(XDisplay* display) {
318 // Creates an invisible, InputOnly toplevel window. This window will receive
319 // all mouse movement for drags. It turns out that normal windows doing a
320 // grab doesn't redirect pointer motion events if the pointer isn't over the
321 // grabbing window. But InputOnly windows are able to grab everything. This
322 // is what GTK+ does, and I found a patch to KDE that did something similar.
323 unsigned long attribute_mask = CWEventMask | CWOverrideRedirect;
324 XSetWindowAttributes swa;
325 memset(&swa, 0, sizeof(swa));
326 swa.event_mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
327 KeyPressMask | KeyReleaseMask | StructureNotifyMask;
328 swa.override_redirect = True;
329 Window window = XCreateWindow(display,
330 DefaultRootWindow(display),
331 -100, -100, 10, 10,
332 0, CopyFromParent, InputOnly, CopyFromParent,
333 attribute_mask, &swa);
334 XMapRaised(display, window);
335 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(window);
336 return window;
337 }
338
339 void X11WholeScreenMoveLoop::CreateDragImageWindow() {
340 Widget* widget = new Widget;
341 Widget::InitParams params(Widget::InitParams::TYPE_DRAG);
342 params.opacity = Widget::InitParams::OPAQUE_WINDOW;
343 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
344 params.accept_events = false;
345
346 gfx::Point location = gfx::ToFlooredPoint(
347 gfx::Screen::GetNativeScreen()->GetCursorScreenPoint() - drag_offset_);
348 params.bounds = gfx::Rect(location, drag_image_.size());
349 widget->set_focus_on_creation(false);
350 widget->set_frame_type(Widget::FRAME_TYPE_FORCE_NATIVE);
351 widget->Init(params);
352 widget->SetOpacity(kDragWidgetOpacity);
353 widget->GetNativeWindow()->SetName("DragWindow");
354
355 ImageView* image = new ImageView();
356 image->SetImage(drag_image_);
357 image->SetBounds(0, 0, drag_image_.width(), drag_image_.height());
358 widget->SetContentsView(image);
359 widget->Show();
360 widget->GetNativeWindow()->layer()->SetFillsBoundsOpaquely(false);
361
362 drag_widget_.reset(widget);
363 }
364
365 bool X11WholeScreenMoveLoop::CheckIfIconValid() {
366 // Because we need a GL context per window, we do a quick check so that we
367 // don't make another context if the window would just be displaying a mostly
368 // transparent image.
369 const SkBitmap* in_bitmap = drag_image_.bitmap();
370 SkAutoLockPixels in_lock(*in_bitmap);
371 for (int y = 0; y < in_bitmap->height(); ++y) {
372 uint32* in_row = in_bitmap->getAddr32(0, y);
373
374 for (int x = 0; x < in_bitmap->width(); ++x) {
375 if (SkColorGetA(in_row[x]) > kMinAlpha)
376 return true;
377 }
378 }
379
380 return false;
381 }
382
383 } // namespace views 192 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698