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

Side by Side Diff: third_party/WebKit/Source/platform/DragImage.cpp

Issue 2873003002: Add stable id to PaintImage. (Closed)
Patch Set: rebase Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 DCHECK_LE(opacity, 1); 109 DCHECK_LE(opacity, 1);
110 paint.setAlpha(opacity * 255); 110 paint.setAlpha(opacity * 255);
111 paint.setFilterQuality(interpolation_quality == kInterpolationNone 111 paint.setFilterQuality(interpolation_quality == kInterpolationNone
112 ? kNone_SkFilterQuality 112 ? kNone_SkFilterQuality
113 : kHigh_SkFilterQuality); 113 : kHigh_SkFilterQuality);
114 114
115 SkCanvas* canvas = surface->getCanvas(); 115 SkCanvas* canvas = surface->getCanvas();
116 canvas->concat(AffineTransformToSkMatrix(transform)); 116 canvas->concat(AffineTransformToSkMatrix(transform));
117 canvas->drawImage(image.sk_image(), 0, 0, &paint); 117 canvas->drawImage(image.sk_image(), 0, 0, &paint);
118 118
119 return PaintImage(surface->makeImageSnapshot(), image.animation_type(), 119 return PaintImage(image.stable_id(), surface->makeImageSnapshot(),
120 image.completion_state()); 120 image.animation_type(), image.completion_state());
121 } 121 }
122 122
123 FloatSize DragImage::ClampedImageScale(const IntSize& image_size, 123 FloatSize DragImage::ClampedImageScale(const IntSize& image_size,
124 const IntSize& size, 124 const IntSize& size,
125 const IntSize& max_size) { 125 const IntSize& max_size) {
126 // Non-uniform scaling for size mapping. 126 // Non-uniform scaling for size mapping.
127 FloatSize image_scale( 127 FloatSize image_scale(
128 static_cast<float>(size.Width()) / image_size.Width(), 128 static_cast<float>(size.Width()) / image_size.Width(),
129 static_cast<float>(size.Height()) / image_size.Height()); 129 static_cast<float>(size.Height()) / image_size.Height());
130 130
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 interpolation_quality_ == kInterpolationNone 322 interpolation_quality_ == kInterpolationNone
323 ? skia::ImageOperations::RESIZE_BOX 323 ? skia::ImageOperations::RESIZE_BOX
324 : skia::ImageOperations::RESIZE_LANCZOS3; 324 : skia::ImageOperations::RESIZE_LANCZOS3;
325 int image_width = scale_x * bitmap_.width(); 325 int image_width = scale_x * bitmap_.width();
326 int image_height = scale_y * bitmap_.height(); 326 int image_height = scale_y * bitmap_.height();
327 bitmap_ = skia::ImageOperations::Resize(bitmap_, resize_method, image_width, 327 bitmap_ = skia::ImageOperations::Resize(bitmap_, resize_method, image_width,
328 image_height); 328 image_height);
329 } 329 }
330 330
331 } // namespace blink 331 } // namespace blink
OLDNEW
« no previous file with comments | « media/renderers/skcanvas_video_renderer.cc ('k') | third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698