| OLD | NEW |
| 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 43 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
| 44 #include "ui/base/events/event.h" | 44 #include "ui/base/events/event.h" |
| 45 #include "ui/base/gestures/gesture_recognizer.h" | 45 #include "ui/base/gestures/gesture_recognizer.h" |
| 46 #include "ui/base/hit_test.h" | 46 #include "ui/base/hit_test.h" |
| 47 #include "ui/base/ime/input_method.h" | 47 #include "ui/base/ime/input_method.h" |
| 48 #include "ui/base/ui_base_types.h" | 48 #include "ui/base/ui_base_types.h" |
| 49 #include "ui/compositor/compositor.h" | 49 #include "ui/compositor/compositor.h" |
| 50 #include "ui/compositor/layer.h" | 50 #include "ui/compositor/layer.h" |
| 51 #include "ui/gfx/canvas.h" | 51 #include "ui/gfx/canvas.h" |
| 52 #include "ui/gfx/display.h" | 52 #include "ui/gfx/display.h" |
| 53 #include "ui/gfx/rect_conversions.h" |
| 53 #include "ui/gfx/screen.h" | 54 #include "ui/gfx/screen.h" |
| 54 #include "ui/gfx/skia_util.h" | 55 #include "ui/gfx/skia_util.h" |
| 55 | 56 |
| 56 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
| 57 #include "ui/base/win/hidden_window.h" | 58 #include "ui/base/win/hidden_window.h" |
| 58 #endif | 59 #endif |
| 59 | 60 |
| 60 using WebKit::WebScreenInfo; | 61 using WebKit::WebScreenInfo; |
| 61 using WebKit::WebTouchEvent; | 62 using WebKit::WebTouchEvent; |
| 62 | 63 |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 // marked as dirty and we show the wrong thing. | 595 // marked as dirty and we show the wrong thing. |
| 595 // We do this after UpdateExternalTexture() so that when we become visible | 596 // We do this after UpdateExternalTexture() so that when we become visible |
| 596 // we're not drawing a stale texture. | 597 // we're not drawing a stale texture. |
| 597 if (host_->is_hidden()) | 598 if (host_->is_hidden()) |
| 598 return; | 599 return; |
| 599 | 600 |
| 600 gfx::Rect clip_rect; | 601 gfx::Rect clip_rect; |
| 601 if (paint_canvas_) { | 602 if (paint_canvas_) { |
| 602 SkRect sk_clip_rect; | 603 SkRect sk_clip_rect; |
| 603 if (paint_canvas_->sk_canvas()->getClipBounds(&sk_clip_rect)) | 604 if (paint_canvas_->sk_canvas()->getClipBounds(&sk_clip_rect)) |
| 604 clip_rect = gfx::SkRectToRect(sk_clip_rect); | 605 clip_rect = gfx::ToEnclosingRect(gfx::SkRectToRectF(sk_clip_rect)); |
| 605 } | 606 } |
| 606 | 607 |
| 607 if (!scroll_rect.IsEmpty()) | 608 if (!scroll_rect.IsEmpty()) |
| 608 SchedulePaintIfNotInClip(scroll_rect, clip_rect); | 609 SchedulePaintIfNotInClip(scroll_rect, clip_rect); |
| 609 | 610 |
| 610 for (size_t i = 0; i < copy_rects.size(); ++i) { | 611 for (size_t i = 0; i < copy_rects.size(); ++i) { |
| 611 gfx::Rect rect = gfx::SubtractRects(copy_rects[i], scroll_rect); | 612 gfx::Rect rect = gfx::SubtractRects(copy_rects[i], scroll_rect); |
| 612 if (rect.IsEmpty()) | 613 if (rect.IsEmpty()) |
| 613 continue; | 614 continue; |
| 614 | 615 |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1977 RenderWidgetHost* widget) { | 1978 RenderWidgetHost* widget) { |
| 1978 return new RenderWidgetHostViewAura(widget); | 1979 return new RenderWidgetHostViewAura(widget); |
| 1979 } | 1980 } |
| 1980 | 1981 |
| 1981 // static | 1982 // static |
| 1982 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 1983 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 1983 GetScreenInfoForWindow(results, NULL); | 1984 GetScreenInfoForWindow(results, NULL); |
| 1984 } | 1985 } |
| 1985 | 1986 |
| 1986 } // namespace content | 1987 } // namespace content |
| OLD | NEW |