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

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

Issue 1834843002: [WIP] Plumbing for paint Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: \o/\o/ Created 4 years, 8 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 "third_party/skia/include/core/SkPicture.h"
9
10 namespace blink {
11
12 void PaintGeneratedImage::draw(SkCanvas* canvas, const SkPaint& paint, const Flo atRect& destRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageCl ampingMode)
13 {
14 SkAutoCanvasRestore ar(canvas, true);
15 canvas->clipRect(destRect);
16 canvas->translate(destRect.x(), destRect.y());
17 if (destRect.size() != srcRect.size())
18 canvas->scale(destRect.width() / srcRect.width(), destRect.height() / sr cRect.height());
19 canvas->translate(-srcRect.x(), -srcRect.y());
20 canvas->drawPicture(m_picture.get());
21 }
22
23 void PaintGeneratedImage::drawTile(GraphicsContext& context, const FloatRect& sr cRect)
24 {
25 // TODO(ikilpatrick): implement.
26 }
27
28 } // 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