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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 42 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
43 #include "ui/base/events/event.h" | 43 #include "ui/base/events/event.h" |
44 #include "ui/base/gestures/gesture_recognizer.h" | 44 #include "ui/base/gestures/gesture_recognizer.h" |
45 #include "ui/base/hit_test.h" | 45 #include "ui/base/hit_test.h" |
46 #include "ui/base/ime/input_method.h" | 46 #include "ui/base/ime/input_method.h" |
47 #include "ui/base/ui_base_types.h" | 47 #include "ui/base/ui_base_types.h" |
48 #include "ui/compositor/compositor.h" | 48 #include "ui/compositor/compositor.h" |
49 #include "ui/compositor/layer.h" | 49 #include "ui/compositor/layer.h" |
50 #include "ui/gfx/canvas.h" | 50 #include "ui/gfx/canvas.h" |
51 #include "ui/gfx/display.h" | 51 #include "ui/gfx/display.h" |
52 #include "ui/gfx/rect_conversions.h" | |
52 #include "ui/gfx/screen.h" | 53 #include "ui/gfx/screen.h" |
53 #include "ui/gfx/skia_util.h" | 54 #include "ui/gfx/skia_util.h" |
54 | 55 |
55 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
56 #include "ui/base/win/hidden_window.h" | 57 #include "ui/base/win/hidden_window.h" |
57 #endif | 58 #endif |
58 | 59 |
59 using WebKit::WebScreenInfo; | 60 using WebKit::WebScreenInfo; |
60 using WebKit::WebTouchEvent; | 61 using WebKit::WebTouchEvent; |
61 | 62 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
573 // marked as dirty and we show the wrong thing. | 574 // marked as dirty and we show the wrong thing. |
574 // We do this after UpdateExternalTexture() so that when we become visible | 575 // We do this after UpdateExternalTexture() so that when we become visible |
575 // we're not drawing a stale texture. | 576 // we're not drawing a stale texture. |
576 if (host_->is_hidden()) | 577 if (host_->is_hidden()) |
577 return; | 578 return; |
578 | 579 |
579 gfx::Rect clip_rect; | 580 gfx::Rect clip_rect; |
580 if (paint_canvas_) { | 581 if (paint_canvas_) { |
581 SkRect sk_clip_rect; | 582 SkRect sk_clip_rect; |
582 if (paint_canvas_->sk_canvas()->getClipBounds(&sk_clip_rect)) | 583 if (paint_canvas_->sk_canvas()->getClipBounds(&sk_clip_rect)) |
583 clip_rect = gfx::SkRectToRect(sk_clip_rect); | 584 clip_rect = gfx::ToEnclosingRect(gfx::SkRectToRectF(sk_clip_rect)); |
danakj
2012/11/01 00:37:00
Maybe you want to use gfx::ToFlooredRectDeprecated
| |
584 } | 585 } |
585 | 586 |
586 if (!scroll_rect.IsEmpty()) | 587 if (!scroll_rect.IsEmpty()) |
587 SchedulePaintIfNotInClip(scroll_rect, clip_rect); | 588 SchedulePaintIfNotInClip(scroll_rect, clip_rect); |
588 | 589 |
589 for (size_t i = 0; i < copy_rects.size(); ++i) { | 590 for (size_t i = 0; i < copy_rects.size(); ++i) { |
590 gfx::Rect rect = gfx::SubtractRects(copy_rects[i], scroll_rect); | 591 gfx::Rect rect = gfx::SubtractRects(copy_rects[i], scroll_rect); |
591 if (rect.IsEmpty()) | 592 if (rect.IsEmpty()) |
592 continue; | 593 continue; |
593 | 594 |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1916 RenderWidgetHost* widget) { | 1917 RenderWidgetHost* widget) { |
1917 return new RenderWidgetHostViewAura(widget); | 1918 return new RenderWidgetHostViewAura(widget); |
1918 } | 1919 } |
1919 | 1920 |
1920 // static | 1921 // static |
1921 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 1922 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
1922 GetScreenInfoForWindow(results, NULL); | 1923 GetScreenInfoForWindow(results, NULL); |
1923 } | 1924 } |
1924 | 1925 |
1925 } // namespace content | 1926 } // namespace content |
OLD | NEW |