OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
4 * Copyright (C) 2007-2008 Torch Mobile, Inc. | 4 * Copyright (C) 2007-2008 Torch Mobile, Inc. |
5 * Copyright (C) 2013 Google, Inc. All rights reserved. | 5 * Copyright (C) 2013 Google, Inc. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 class PLATFORM_EXPORT Pattern : public RefCounted<Pattern> { | 45 class PLATFORM_EXPORT Pattern : public RefCounted<Pattern> { |
46 public: | 46 public: |
47 enum RepeatMode { | 47 enum RepeatMode { |
48 RepeatModeX = 1 << 0, | 48 RepeatModeX = 1 << 0, |
49 RepeatModeY = 1 << 1, | 49 RepeatModeY = 1 << 1, |
50 | 50 |
51 RepeatModeNone = 0, | 51 RepeatModeNone = 0, |
52 RepeatModeXY = RepeatModeX | RepeatModeY | 52 RepeatModeXY = RepeatModeX | RepeatModeY |
53 }; | 53 }; |
54 | 54 |
55 static PassRefPtr<Pattern> createBitmapPattern(PassRefPtr<Image> tileImage, | 55 static PassRefPtr<Pattern> createImagePattern(PassRefPtr<Image>, RepeatMode
= RepeatModeXY); |
56 RepeatMode = RepeatModeXY); | |
57 static PassRefPtr<Pattern> createPicturePattern(PassRefPtr<const SkPicture>, | 56 static PassRefPtr<Pattern> createPicturePattern(PassRefPtr<const SkPicture>, |
58 RepeatMode = RepeatModeXY); | 57 RepeatMode = RepeatModeXY); |
59 virtual ~Pattern(); | 58 virtual ~Pattern(); |
60 | 59 |
61 SkShader* shader(); | 60 SkShader* shader(); |
62 | 61 |
63 void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformat
ion); | 62 void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformat
ion); |
64 const AffineTransform& patternSpaceTransform() const { return m_patternSpace
Transformation; } | 63 const AffineTransform& patternSpaceTransform() const { return m_patternSpace
Transformation; } |
65 | 64 |
66 bool isRepeatX() { return m_repeatMode & RepeatModeX; } | 65 bool isRepeatX() { return m_repeatMode & RepeatModeX; } |
(...skipping 11 matching lines...) Expand all Loading... |
78 Pattern(RepeatMode, int64_t externalMemoryAllocated = 0); | 77 Pattern(RepeatMode, int64_t externalMemoryAllocated = 0); |
79 | 78 |
80 private: | 79 private: |
81 RefPtr<SkShader> m_pattern; | 80 RefPtr<SkShader> m_pattern; |
82 int64_t m_externalMemoryAllocated; | 81 int64_t m_externalMemoryAllocated; |
83 }; | 82 }; |
84 | 83 |
85 } // namespace blink | 84 } // namespace blink |
86 | 85 |
87 #endif | 86 #endif |
OLD | NEW |