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

Unified Diff: chrome/browser/views/tabs/tab_overview_cell.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/views/tabs/tab_overview_cell.cc
diff --git a/chrome/browser/views/tabs/tab_overview_cell.cc b/chrome/browser/views/tabs/tab_overview_cell.cc
index c05aae318e0a6c7aaf05b5062a2d51ba54bfb8e2..b0b5f9f3f9d3bd02212363cfc41f1fc776e92b0d 100644
--- a/chrome/browser/views/tabs/tab_overview_cell.cc
+++ b/chrome/browser/views/tabs/tab_overview_cell.cc
@@ -6,6 +6,7 @@
#include "app/gfx/favicon_size.h"
#include "base/string_util.h"
+#include "skia/ext/image_operations.h"
#include "views/border.h"
#include "views/controls/image_view.h"
#include "views/controls/label.h"
@@ -64,7 +65,10 @@ TabOverviewCell::TabOverviewCell() {
}
void TabOverviewCell::SetThumbnail(const SkBitmap& thumbnail) {
- thumbnail_view_->SetImage(thumbnail);
+ // Do mipmapped-based resampling to get closer to the correct size. The
+ // input bitmap isn't guaranteed to have any specific resolution.
+ thumbnail_view_->SetImage(skia::ImageOperations::DownsampleByTwoUntilSize(
+ thumbnail, kThumbnailWidth, kThumbnailHeight));
}
void TabOverviewCell::SetTitle(const string16& title) {
« no previous file with comments | « chrome/browser/tab_contents/thumbnail_generator.cc ('k') | chrome/browser/views/tabs/tab_overview_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698