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

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

Issue 1866623002: Hook up CSSPaintValue::image to CSS Paint API callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments + rebase. Created 4 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "platform/graphics/PaintGeneratedImage.h"
6
7 #include "platform/geometry/FloatRect.h"
8 #include "platform/graphics/GraphicsContext.h"
9 #include "third_party/skia/include/core/SkPicture.h"
10
11 namespace blink {
12
13 void PaintGeneratedImage::draw(SkCanvas* canvas, const SkPaint& paint, const Flo atRect& destRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageCl ampingMode)
14 {
15 SkAutoCanvasRestore ar(canvas, true);
16 canvas->clipRect(destRect);
17 canvas->translate(destRect.x(), destRect.y());
18 if (destRect.size() != srcRect.size())
19 canvas->scale(destRect.width() / srcRect.width(), destRect.height() / sr cRect.height());
20 canvas->translate(-srcRect.x(), -srcRect.y());
21 canvas->drawPicture(m_picture.get(), nullptr, &paint);
22 }
23
24 void PaintGeneratedImage::drawTile(GraphicsContext& context, const FloatRect& sr cRect)
25 {
26 context.drawPicture(m_picture.get());
27 }
28
29 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698