OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ |
| 6 #define SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ |
| 7 |
| 8 #include "dart/runtime/include/dart_api.h" |
| 9 #include "sky/engine/tonic/dart_wrappable.h" |
| 10 #include "third_party/skia/include/effects/SkLayerDrawLooper.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class DrawLooperLayerInfo : public RefCounted<DrawLooperLayerInfo>, |
| 15 public DartWrappable { |
| 16 DEFINE_WRAPPERTYPEINFO(); |
| 17 public: |
| 18 static PassRefPtr<DrawLooperLayerInfo> create() |
| 19 { |
| 20 return adoptRef(new DrawLooperLayerInfo); |
| 21 } |
| 22 ~DrawLooperLayerInfo() override; |
| 23 |
| 24 void setPaintBits(unsigned bits) { layer_info_.fPaintBits = bits; } |
| 25 void setColorMode(unsigned mode) { |
| 26 layer_info_.fColorMode = static_cast<SkXfermode::Mode>(mode); |
| 27 } |
| 28 void setOffset(float x, float y) { layer_info_.fOffset.set(x, y); } |
| 29 void setPostTranslate(bool val) { layer_info_.fPostTranslate = val; } |
| 30 |
| 31 const SkLayerDrawLooper::LayerInfo& layer_info() const { return layer_info_; } |
| 32 |
| 33 private: |
| 34 DrawLooperLayerInfo(); |
| 35 |
| 36 SkLayerDrawLooper::LayerInfo layer_info_; |
| 37 }; |
| 38 |
| 39 } // namespace blink |
| 40 |
| 41 #endif // SKY_ENGINE_CORE_PAINTING_DRAWLOOPERLAYERINFO_H_ |
OLD | NEW |