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

Side by Side Diff: views/controls/image_view.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 | « chrome/browser/views/tabs/tab_overview_controller.cc ('k') | no next file » | 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) 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/controls/image_view.h" 5 #include "views/controls/image_view.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/insets.h" 8 #include "app/gfx/insets.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if (image_width == 0 || image_height == 0) 118 if (image_width == 0 || image_height == 0)
119 return; 119 return;
120 120
121 int x, y; 121 int x, y;
122 if (image_size_set_ && 122 if (image_size_set_ &&
123 (image_size_.width() != image_width || 123 (image_size_.width() != image_width ||
124 image_size_.width() != image_height)) { 124 image_size_.width() != image_height)) {
125 // Resize case 125 // Resize case
126 image_.buildMipMap(false); 126 image_.buildMipMap(false);
127 ComputeImageOrigin(image_size_.width(), image_size_.height(), &x, &y); 127 ComputeImageOrigin(image_size_.width(), image_size_.height(), &x, &y);
128 SkPaint paint;
129 paint.setFilterBitmap(true);
128 canvas->DrawBitmapInt(image_, 0, 0, image_width, image_height, 130 canvas->DrawBitmapInt(image_, 0, 0, image_width, image_height,
129 x, y, image_size_.width(), image_size_.height(), 131 x, y, image_size_.width(), image_size_.height(),
130 true); 132 true, paint);
131 } else { 133 } else {
132 ComputeImageOrigin(image_width, image_height, &x, &y); 134 ComputeImageOrigin(image_width, image_height, &x, &y);
133 canvas->DrawBitmapInt(image_, x, y); 135 canvas->DrawBitmapInt(image_, x, y);
134 } 136 }
135 } 137 }
136 138
137 void ImageView::SetHorizontalAlignment(Alignment ha) { 139 void ImageView::SetHorizontalAlignment(Alignment ha) {
138 if (ha != horiz_alignment_) { 140 if (ha != horiz_alignment_) {
139 horiz_alignment_ = ha; 141 horiz_alignment_ = ha;
140 SchedulePaint(); 142 SchedulePaint();
(...skipping 26 matching lines...) Expand all
167 bool ImageView::GetTooltipText(int x, int y, std::wstring* tooltip) { 169 bool ImageView::GetTooltipText(int x, int y, std::wstring* tooltip) {
168 if (tooltip_text_.empty()) { 170 if (tooltip_text_.empty()) {
169 return false; 171 return false;
170 } else { 172 } else {
171 * tooltip = GetTooltipText(); 173 * tooltip = GetTooltipText();
172 return true; 174 return true;
173 } 175 }
174 } 176 }
175 177
176 } // namespace views 178 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/views/tabs/tab_overview_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698