OLD | NEW |
(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 |
OLD | NEW |