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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp

Issue 2743363006: Clean up cc/paint interfaces (Closed)
Patch Set: Fix PaintControllerTest v2 Created 3 years, 9 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "platform/graphics/StaticBitmapImage.h" 5 #include "platform/graphics/StaticBitmapImage.h"
6 6
7 #include "platform/graphics/AcceleratedStaticBitmapImage.h" 7 #include "platform/graphics/AcceleratedStaticBitmapImage.h"
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/ImageObserver.h" 9 #include "platform/graphics/ImageObserver.h"
10 #include "platform/graphics/UnacceleratedStaticBitmapImage.h" 10 #include "platform/graphics/UnacceleratedStaticBitmapImage.h"
(...skipping 17 matching lines...) Expand all
28 const FloatRect& dstRect, 28 const FloatRect& dstRect,
29 const FloatRect& srcRect, 29 const FloatRect& srcRect,
30 ImageClampingMode clampMode, 30 ImageClampingMode clampMode,
31 sk_sp<SkImage> image) { 31 sk_sp<SkImage> image) {
32 FloatRect adjustedSrcRect = srcRect; 32 FloatRect adjustedSrcRect = srcRect;
33 adjustedSrcRect.intersect(SkRect::Make(image->bounds())); 33 adjustedSrcRect.intersect(SkRect::Make(image->bounds()));
34 34
35 if (dstRect.isEmpty() || adjustedSrcRect.isEmpty()) 35 if (dstRect.isEmpty() || adjustedSrcRect.isEmpty())
36 return; // Nothing to draw. 36 return; // Nothing to draw.
37 37
38 canvas->drawImageRect(image.get(), adjustedSrcRect, dstRect, &flags, 38 canvas->drawImageRect(std::move(image), adjustedSrcRect, dstRect, &flags,
39 WebCoreClampingModeToSkiaRectConstraint(clampMode)); 39 WebCoreClampingModeToSkiaRectConstraint(clampMode));
40 } 40 }
41 41
42 } // namespace blink 42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698