OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ | 5 #ifndef SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ |
6 #define SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ | 6 #define SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ |
7 | 7 |
8 #include "dart/runtime/include/dart_api.h" | 8 #include "dart/runtime/include/dart_api.h" |
9 #include "sky/engine/core/painting/Point.h" | 9 #include "sky/engine/core/painting/Offset.h" |
10 #include "sky/engine/core/painting/TransferMode.h" | 10 #include "sky/engine/core/painting/TransferMode.h" |
11 #include "sky/engine/tonic/dart_wrappable.h" | 11 #include "sky/engine/tonic/dart_wrappable.h" |
| 12 #include "third_party/skia/include/core/SkPoint.h" |
12 #include "third_party/skia/include/effects/SkLayerDrawLooper.h" | 13 #include "third_party/skia/include/effects/SkLayerDrawLooper.h" |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 class DrawLooperLayerInfo : public RefCounted<DrawLooperLayerInfo>, | 17 class DrawLooperLayerInfo : public RefCounted<DrawLooperLayerInfo>, |
17 public DartWrappable { | 18 public DartWrappable { |
18 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
19 public: | 20 public: |
20 static PassRefPtr<DrawLooperLayerInfo> create() | 21 static PassRefPtr<DrawLooperLayerInfo> create() |
21 { | 22 { |
22 return adoptRef(new DrawLooperLayerInfo); | 23 return adoptRef(new DrawLooperLayerInfo); |
23 } | 24 } |
24 ~DrawLooperLayerInfo() override; | 25 ~DrawLooperLayerInfo() override; |
25 | 26 |
26 void setPaintBits(unsigned bits) { layer_info_.fPaintBits = bits; } | 27 void setPaintBits(unsigned bits) { layer_info_.fPaintBits = bits; } |
27 void setColorMode(SkXfermode::Mode mode) { layer_info_.fColorMode = mode; } | 28 void setColorMode(SkXfermode::Mode mode) { layer_info_.fColorMode = mode; } |
28 void setOffset(Point offset) { layer_info_.fOffset = offset.sk_point; } | 29 void setOffset(Offset offset) { layer_info_.fOffset = SkPoint::Make(offset.sk_
size.width(), offset.sk_size.height()); } |
29 void setPostTranslate(bool val) { layer_info_.fPostTranslate = val; } | 30 void setPostTranslate(bool val) { layer_info_.fPostTranslate = val; } |
30 | 31 |
31 const SkLayerDrawLooper::LayerInfo& layer_info() const { return layer_info_; } | 32 const SkLayerDrawLooper::LayerInfo& layer_info() const { return layer_info_; } |
32 | 33 |
33 private: | 34 private: |
34 DrawLooperLayerInfo(); | 35 DrawLooperLayerInfo(); |
35 | 36 |
36 SkLayerDrawLooper::LayerInfo layer_info_; | 37 SkLayerDrawLooper::LayerInfo layer_info_; |
37 }; | 38 }; |
38 | 39 |
39 } // namespace blink | 40 } // namespace blink |
40 | 41 |
41 #endif // SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ | 42 #endif // SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ |
OLD | NEW |