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

Side by Side Diff: sky/engine/core/painting/Paint.h

Issue 1185423003: Add a Paint::toString() method to describe our Paint objects. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: abarth Created 5 years, 6 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
« no previous file with comments | « no previous file | sky/engine/core/painting/Paint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_PAINT_H_ 5 #ifndef SKY_ENGINE_CORE_PAINTING_PAINT_H_
6 #define SKY_ENGINE_CORE_PAINTING_PAINT_H_ 6 #define SKY_ENGINE_CORE_PAINTING_PAINT_H_
7 7
8 #include "sky/engine/core/painting/CanvasColor.h" 8 #include "sky/engine/core/painting/CanvasColor.h"
9 #include "sky/engine/core/painting/PaintingStyle.h" 9 #include "sky/engine/core/painting/PaintingStyle.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 "sky/engine/wtf/PassRefPtr.h" 12 #include "sky/engine/wtf/PassRefPtr.h"
13 #include "sky/engine/wtf/RefCounted.h" 13 #include "sky/engine/wtf/RefCounted.h"
14 #include "sky/engine/wtf/text/WTFString.h"
14 #include "third_party/skia/include/core/SkPaint.h" 15 #include "third_party/skia/include/core/SkPaint.h"
15 16
16 namespace blink { 17 namespace blink {
17 18
18 class DrawLooper; 19 class DrawLooper;
19 class ColorFilter; 20 class ColorFilter;
20 class MaskFilter; 21 class MaskFilter;
21 class Shader; 22 class Shader;
22 23
23 class Paint : public RefCounted<Paint>, public DartWrappable { 24 class Paint : public RefCounted<Paint>, public DartWrappable {
24 DEFINE_WRAPPERTYPEINFO(); 25 DEFINE_WRAPPERTYPEINFO();
25 public: 26 public:
26 ~Paint() override; 27 ~Paint() override;
27 static PassRefPtr<Paint> create() 28 static PassRefPtr<Paint> create() { return adoptRef(new Paint); }
28 {
29 return adoptRef(new Paint);
30 }
31 29
32 bool isAntiAlias() const { return m_paint.isAntiAlias(); } 30 bool isAntiAlias() const { return paint_.isAntiAlias(); }
33 void setIsAntiAlias(bool value) { m_paint.setAntiAlias(value); } 31 void setIsAntiAlias(bool value) { paint_.setAntiAlias(value); }
34 32
35 SkColor color() const { return m_paint.getColor(); } 33 SkColor color() const { return paint_.getColor(); }
36 void setColor(SkColor color) { m_paint.setColor(color); } 34 void setColor(SkColor color) { paint_.setColor(color); }
37 35
38 SkScalar strokeWidth() const { return m_paint.getStrokeWidth(); } 36 SkScalar strokeWidth() const { return paint_.getStrokeWidth(); }
39 void setStrokeWidth(SkScalar strokeWidth) { m_paint.setStrokeWidth(strokeWid th); } 37 void setStrokeWidth(SkScalar strokeWidth) {
38 paint_.setStrokeWidth(strokeWidth);
39 }
40 40
41 void setDrawLooper(DrawLooper* looper); 41 void setDrawLooper(DrawLooper* looper);
42 void setColorFilter(ColorFilter* filter); 42 void setColorFilter(ColorFilter* filter);
43 void setMaskFilter(MaskFilter* filter); 43 void setMaskFilter(MaskFilter* filter);
44 void setShader(Shader* shader); 44 void setShader(Shader* shader);
45 void setStyle(SkPaint::Style style); 45 void setStyle(SkPaint::Style style);
46 void setTransferMode(SkXfermode::Mode transfer_mode); 46 void setTransferMode(SkXfermode::Mode transfer_mode);
47 47
48 const SkPaint& paint() const { return m_paint; } 48 const SkPaint& paint() const { return paint_; }
49 void setPaint(const SkPaint& paint) { m_paint = paint; } 49 void setPaint(const SkPaint& paint) { paint_ = paint; }
50 50
51 private: 51 String toString() const;
52 Paint();
53 52
54 SkPaint m_paint; 53 private:
54 Paint();
55
56 SkPaint paint_;
55 }; 57 };
56 58
57 } // namespace blink 59 } // namespace blink
58 60
59 #endif // SKY_ENGINE_CORE_PAINTING_PAINT_H_ 61 #endif // SKY_ENGINE_CORE_PAINTING_PAINT_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/painting/Paint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698