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

Side by Side Diff: Source/platform/graphics/DisplayListPattern.cpp

Issue 453653003: [SVG] DisplayList-based patterns. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/DisplayListPattern.h ('k') | Source/platform/graphics/Pattern.h » ('j') | 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 2014 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 "config.h"
6 #include "platform/graphics/DisplayListPattern.h"
7
8 #include "platform/graphics/DisplayList.h"
9 #include "platform/graphics/skia/SkiaUtils.h"
10 #include "third_party/skia/include/core/SkShader.h"
11
12 namespace blink {
13
14 DisplayListPattern::DisplayListPattern(PassRefPtr<DisplayList> displayList, Repe atMode mode)
15 : Pattern(mode)
16 , m_tileDisplayList(displayList)
17 {
18 // All current clients use RepeatModeXY, so we only support this mode for no w.
19 ASSERT(isRepeatXY());
20
21 // FIXME: we don't have a good way to account for DL memory utilization.
22 }
23
24 DisplayListPattern::~DisplayListPattern()
25 {
26 }
27
28 PassRefPtr<SkShader> DisplayListPattern::createShader()
29 {
30 SkMatrix localMatrix = affineTransformToSkMatrix(m_patternSpaceTransformatio n);
31 SkRect tileBounds = SkRect::MakeWH(m_tileDisplayList->bounds().width(),
32 m_tileDisplayList->bounds().height());
33
34 return adoptRef(SkShader::CreatePictureShader(m_tileDisplayList->picture(),
35 SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix, &t ileBounds));
36 }
37
38 } // namespace
OLDNEW
« no previous file with comments | « Source/platform/graphics/DisplayListPattern.h ('k') | Source/platform/graphics/Pattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698