| OLD | NEW |
| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 if (image_.isNull()) | 223 if (image_.isNull()) |
| 224 return; | 224 return; |
| 225 | 225 |
| 226 gfx::Rect image_bounds(GetImageBounds()); | 226 gfx::Rect image_bounds(GetImageBounds()); |
| 227 if (image_bounds.IsEmpty()) | 227 if (image_bounds.IsEmpty()) |
| 228 return; | 228 return; |
| 229 | 229 |
| 230 if (image_bounds.size() != gfx::Size(image_.width(), image_.height())) { | 230 if (image_bounds.size() != gfx::Size(image_.width(), image_.height())) { |
| 231 // Resize case | 231 // Resize case |
| 232 SkPaint paint; | 232 SkPaint paint; |
| 233 paint.setFilterLevel(SkPaint::kLow_FilterLevel); | 233 paint.setFilterQuality(kLow_SkFilterQuality); |
| 234 canvas->DrawImageInt(image_, 0, 0, image_.width(), image_.height(), | 234 canvas->DrawImageInt(image_, 0, 0, image_.width(), image_.height(), |
| 235 image_bounds.x(), image_bounds.y(), image_bounds.width(), | 235 image_bounds.x(), image_bounds.y(), image_bounds.width(), |
| 236 image_bounds.height(), true, paint); | 236 image_bounds.height(), true, paint); |
| 237 } else { | 237 } else { |
| 238 canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y()); | 238 canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y()); |
| 239 } | 239 } |
| 240 last_painted_bitmap_pixels_ = GetBitmapPixels(image_, last_paint_scale_); | 240 last_painted_bitmap_pixels_ = GetBitmapPixels(image_, last_paint_scale_); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace views | 243 } // namespace views |
| OLD | NEW |