| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/widget/root_view.h" | 5 #include "views/widget/root_view.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas_paint.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "views/widget/widget_gtk.h" | 11 #include "views/widget/widget_gtk.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 | 14 |
| 15 void RootView::OnPaint(GdkEventExpose* event) { | 15 void RootView::OnPaint(GdkEventExpose* event) { |
| 16 gfx::CanvasPaint canvas(event); | 16 gfx::CanvasPaint canvas(event); |
| 17 | 17 |
| 18 if (!canvas.isEmpty()) { | 18 if (!canvas.is_empty()) { |
| 19 canvas.set_composite_alpha( | 19 canvas.set_composite_alpha( |
| 20 static_cast<WidgetGtk*>(GetWidget())->is_transparent()); | 20 static_cast<WidgetGtk*>(GetWidget())->is_transparent()); |
| 21 SchedulePaint(gfx::Rect(canvas.rectangle()), false); | 21 SchedulePaint(gfx::Rect(canvas.rectangle()), false); |
| 22 if (NeedsPainting(false)) { | 22 if (NeedsPainting(false)) { |
| 23 ProcessPaint(&canvas); | 23 ProcessPaint(&canvas); |
| 24 } | 24 } |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 | 27 |
| 28 } | 28 } |
| OLD | NEW |