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

Side by Side Diff: chrome/browser/gtk/tabs/dragged_tab_gtk.cc

Issue 144006: Add Linux support for getting the thumbnail and wire into the switcher. (Closed)
Patch Set: For checkin Created 11 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/renderer_host/backing_store.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/gtk/tabs/dragged_tab_gtk.h" 5 #include "chrome/browser/gtk/tabs/dragged_tab_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 8
9 #include "app/gfx/canvas_paint.h" 9 #include "app/gfx/canvas_paint.h"
10 #include "base/gfx/gtk_util.h" 10 #include "base/gfx/gtk_util.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 gfx::Canvas canvas(ps.width(), ps.height(), false); 280 gfx::Canvas canvas(ps.width(), ps.height(), false);
281 canvas.drawRect(rc, paint); 281 canvas.drawRect(rc, paint);
282 282
283 return canvas.ExtractBitmap(); 283 return canvas.ExtractBitmap();
284 } 284 }
285 285
286 void DraggedTabGtk::PaintScreenshotIntoCanvas(gfx::Canvas* canvas, 286 void DraggedTabGtk::PaintScreenshotIntoCanvas(gfx::Canvas* canvas,
287 const gfx::Rect& target_bounds) { 287 const gfx::Rect& target_bounds) {
288 gfx::Rect rect(0, 0, 288 gfx::Rect rect(0, 0,
289 contents_->allocation.width, contents_->allocation.height); 289 contents_->allocation.width, contents_->allocation.height);
290 SkBitmap* bitmap = backing_store_->PaintRectToBitmap(rect); 290 SkBitmap bitmap = backing_store_->PaintRectToBitmap(rect);
291 if (bitmap) { 291 if (!bitmap.isNull())
292 canvas->DrawBitmapInt(*bitmap, 0, renderer_->bounds().height()); 292 canvas->DrawBitmapInt(bitmap, 0, renderer_->bounds().height());
293 delete bitmap;
294 }
295 } 293 }
296 294
297 // static 295 // static
298 gboolean DraggedTabGtk::OnExposeEvent(GtkWidget* widget, 296 gboolean DraggedTabGtk::OnExposeEvent(GtkWidget* widget,
299 GdkEventExpose* event, 297 GdkEventExpose* event,
300 DraggedTabGtk* dragged_tab) { 298 DraggedTabGtk* dragged_tab) {
301 SkBitmap bmp; 299 SkBitmap bmp;
302 if (dragged_tab->attached_) { 300 if (dragged_tab->attached_) {
303 bmp = dragged_tab->PaintAttachedTab(); 301 bmp = dragged_tab->PaintAttachedTab();
304 } else { 302 } else {
305 bmp = dragged_tab->PaintDetachedView(); 303 bmp = dragged_tab->PaintDetachedView();
306 } 304 }
307 305
308 if (gtk_util::IsScreenComposited()) { 306 if (gtk_util::IsScreenComposited()) {
309 dragged_tab->SetContainerTransparency(); 307 dragged_tab->SetContainerTransparency();
310 } else { 308 } else {
311 dragged_tab->SetContainerShapeMask(bmp); 309 dragged_tab->SetContainerShapeMask(bmp);
312 } 310 }
313 311
314 gfx::CanvasPaint canvas(event, false); 312 gfx::CanvasPaint canvas(event, false);
315 canvas.DrawBitmapInt(bmp, 0, 0); 313 canvas.DrawBitmapInt(bmp, 0, 0);
316 314
317 // We've already drawn the tab, so don't propagate the expose-event signal. 315 // We've already drawn the tab, so don't propagate the expose-event signal.
318 return TRUE; 316 return TRUE;
319 } 317 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698