summaryrefslogtreecommitdiff
path: root/chromium/ui/message_center
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-27 09:07:56 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-27 08:12:41 +0000
commit98ff39cb35ef2bd32bb1af9565628a4a4b0979b2 (patch)
tree151fe6c7d22b64f237f2f452cc72b581274a02d6 /chromium/ui/message_center
parentaf3d4809763ef308f08ced947a73b624729ac7ea (diff)
downloadqtwebengine-chromium-98ff39cb35ef2bd32bb1af9565628a4a4b0979b2.tar.gz
BASELINE: Update Chromium to 47.0.2526.34 and Ninja to 1.6.0
Change-Id: Ie8863b493c7ff19eb46478935dfe7602679b227e Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'chromium/ui/message_center')
-rw-r--r--chromium/ui/message_center/views/proportional_image_view.cc24
1 files changed, 7 insertions, 17 deletions
diff --git a/chromium/ui/message_center/views/proportional_image_view.cc b/chromium/ui/message_center/views/proportional_image_view.cc
index 217832436df..a7befd66fb2 100644
--- a/chromium/ui/message_center/views/proportional_image_view.cc
+++ b/chromium/ui/message_center/views/proportional_image_view.cc
@@ -5,6 +5,7 @@
#include "ui/message_center/views/proportional_image_view.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/image/image_skia_operations.h"
#include "ui/message_center/message_center_style.h"
namespace message_center {
@@ -33,29 +34,18 @@ void ProportionalImageView::OnPaint(gfx::Canvas* canvas) {
views::View::OnPaint(canvas);
gfx::Size draw_size = GetImageDrawingSize();
-
if (draw_size.IsEmpty())
return;
gfx::Rect draw_bounds = GetContentsBounds();
draw_bounds.ClampToCenteredSize(draw_size);
- gfx::Size image_size(image_.size());
-
- if (image_size == draw_size) {
- canvas->DrawImageInt(image_, draw_bounds.x(), draw_bounds.y());
- } else {
- SkPaint paint;
- paint.setFilterQuality(kLow_SkFilterQuality);
-
- // This call resizes the image while drawing into the canvas.
- canvas->DrawImageInt(
- image_,
- 0, 0, image_size.width(), image_size.height(),
- draw_bounds.x(), draw_bounds.y(), draw_size.width(), draw_size.height(),
- true,
- paint);
- }
+ gfx::ImageSkia image =
+ (image_.size() == draw_size)
+ ? image_
+ : gfx::ImageSkiaOperations::CreateResizedImage(
+ image_, skia::ImageOperations::RESIZE_BEST, draw_size);
+ canvas->DrawImageInt(image, draw_bounds.x(), draw_bounds.y());
}
const char* ProportionalImageView::GetClassName() const {