| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/gtk/tabs/dragged_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/dragged_view_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/debug/trace_event.h" |
| 11 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 13 #include "chrome/browser/extensions/extension_tab_helper.h" | 14 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/tabs/tab_strip_model.h" | 16 #include "chrome/browser/tabs/tab_strip_model.h" |
| 16 #include "chrome/browser/themes/theme_service.h" | 17 #include "chrome/browser/themes/theme_service.h" |
| 17 #include "chrome/browser/themes/theme_service_factory.h" | 18 #include "chrome/browser/themes/theme_service_factory.h" |
| 18 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 19 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 19 #include "chrome/browser/ui/gtk/gtk_util.h" | 20 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 20 #include "chrome/browser/ui/gtk/tabs/drag_data.h" | 21 #include "chrome/browser/ui/gtk/tabs/drag_data.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 365 } |
| 365 | 366 |
| 366 cairo_destroy(cairo_context); | 367 cairo_destroy(cairo_context); |
| 367 | 368 |
| 368 // Set the shape mask. | 369 // Set the shape mask. |
| 369 gdk_window_shape_combine_mask(container_->window, pixmap, 0, 0); | 370 gdk_window_shape_combine_mask(container_->window, pixmap, 0, 0); |
| 370 g_object_unref(pixmap); | 371 g_object_unref(pixmap); |
| 371 } | 372 } |
| 372 | 373 |
| 373 gboolean DraggedViewGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) { | 374 gboolean DraggedViewGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) { |
| 375 TRACE_EVENT0("ui::gtk", "DraggedViewGtk::OnExpose"); |
| 376 |
| 374 if (ui::IsScreenComposited()) | 377 if (ui::IsScreenComposited()) |
| 375 SetContainerTransparency(); | 378 SetContainerTransparency(); |
| 376 else | 379 else |
| 377 SetContainerShapeMask(); | 380 SetContainerShapeMask(); |
| 378 | 381 |
| 379 // Only used when not attached. | 382 // Only used when not attached. |
| 380 int tab_height = static_cast<int>( | 383 int tab_height = static_cast<int>( |
| 381 kScalingFactor * renderers_[drag_data_->source_tab_index()]->height()); | 384 kScalingFactor * renderers_[drag_data_->source_tab_index()]->height()); |
| 382 | 385 |
| 383 // Draw the render area. | 386 // Draw the render area. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 if (!attached_) { | 452 if (!attached_) { |
| 450 paint_at = widget_width / kScalingFactor - | 453 paint_at = widget_width / kScalingFactor - |
| 451 GetWidthInTabStripFromTo(0, index + 1); | 454 GetWidthInTabStripFromTo(0, index + 1); |
| 452 } | 455 } |
| 453 } | 456 } |
| 454 | 457 |
| 455 cairo_set_source_surface(cr, surface, paint_at, 0); | 458 cairo_set_source_surface(cr, surface, paint_at, 0); |
| 456 cairo_paint(cr); | 459 cairo_paint(cr); |
| 457 cairo_surface_destroy(surface); | 460 cairo_surface_destroy(surface); |
| 458 } | 461 } |
| OLD | NEW |