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

Side by Side Diff: ui/views/controls/image_view.cc

Issue 271653003: Scrub deprecated Skia APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/image_view.h" 5 #include "ui/views/controls/image_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "third_party/skia/include/core/SkPaint.h" 9 #include "third_party/skia/include/core/SkPaint.h"
10 #include "ui/accessibility/ax_view_state.h" 10 #include "ui/accessibility/ax_view_state.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if (image_.isNull()) 217 if (image_.isNull())
218 return; 218 return;
219 219
220 gfx::Rect image_bounds(GetImageBounds()); 220 gfx::Rect image_bounds(GetImageBounds());
221 if (image_bounds.IsEmpty()) 221 if (image_bounds.IsEmpty())
222 return; 222 return;
223 223
224 if (image_bounds.size() != gfx::Size(image_.width(), image_.height())) { 224 if (image_bounds.size() != gfx::Size(image_.width(), image_.height())) {
225 // Resize case 225 // Resize case
226 SkPaint paint; 226 SkPaint paint;
227 paint.setFilterBitmap(true); 227 paint.setFilterLevel(SkPaint::kLow_FilterLevel);
228 canvas->DrawImageInt(image_, 0, 0, image_.width(), image_.height(), 228 canvas->DrawImageInt(image_, 0, 0, image_.width(), image_.height(),
229 image_bounds.x(), image_bounds.y(), image_bounds.width(), 229 image_bounds.x(), image_bounds.y(), image_bounds.width(),
230 image_bounds.height(), true, paint); 230 image_bounds.height(), true, paint);
231 } else { 231 } else {
232 canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y()); 232 canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y());
233 } 233 }
234 last_painted_bitmap_pixels_ = GetBitmapPixels(image_, last_paint_scale_); 234 last_painted_bitmap_pixels_ = GetBitmapPixels(image_, last_paint_scale_);
235 } 235 }
236 236
237 } // namespace views 237 } // namespace views
OLDNEW
« ui/gfx/canvas.h ('K') | « ui/message_center/views/proportional_image_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698