OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 PaintRenderingContext2D_h | 5 #ifndef PaintRenderingContext2D_h |
6 #define PaintRenderingContext2D_h | 6 #define PaintRenderingContext2D_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "modules/canvas2d/BaseRenderingContext2D.h" | 10 #include "modules/canvas2d/BaseRenderingContext2D.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 { | 25 { |
26 return new PaintRenderingContext2D(std::move(imageBuffer)); | 26 return new PaintRenderingContext2D(std::move(imageBuffer)); |
27 } | 27 } |
28 | 28 |
29 // BaseRenderingContext2D | 29 // BaseRenderingContext2D |
30 | 30 |
31 // PaintRenderingContext2D doesn't have any pixel readback so the origin | 31 // PaintRenderingContext2D doesn't have any pixel readback so the origin |
32 // is always clean, and unable to taint it. | 32 // is always clean, and unable to taint it. |
33 bool originClean() const final { return true; } | 33 bool originClean() const final { return true; } |
34 void setOriginTainted() final { } | 34 void setOriginTainted() final { } |
35 bool wouldTaintOrigin(CanvasImageSource*, ScriptState*) final { return false
; } | 35 bool wouldTaintOrigin(CanvasImageSource*) final { return false; } |
36 | 36 |
37 int width() const final; | 37 int width() const final; |
38 int height() const final; | 38 int height() const final; |
39 | 39 |
40 bool hasImageBuffer() const final { return m_imageBuffer.get(); } | 40 bool hasImageBuffer() const final { return m_imageBuffer.get(); } |
41 ImageBuffer* imageBuffer() const final { return m_imageBuffer.get(); } | 41 ImageBuffer* imageBuffer() const final { return m_imageBuffer.get(); } |
42 | 42 |
43 bool parseColorOrCurrentColor(Color&, const String& colorString) const final
; | 43 bool parseColorOrCurrentColor(Color&, const String& colorString) const final
; |
44 | 44 |
45 SkCanvas* drawingCanvas() const final; | 45 SkCanvas* drawingCanvas() const final; |
(...skipping 21 matching lines...) Expand all Loading... |
67 | 67 |
68 private: | 68 private: |
69 explicit PaintRenderingContext2D(PassOwnPtr<ImageBuffer>); | 69 explicit PaintRenderingContext2D(PassOwnPtr<ImageBuffer>); |
70 | 70 |
71 OwnPtr<ImageBuffer> m_imageBuffer; | 71 OwnPtr<ImageBuffer> m_imageBuffer; |
72 }; | 72 }; |
73 | 73 |
74 } // namespace blink | 74 } // namespace blink |
75 | 75 |
76 #endif // PaintRenderingContext2D_h | 76 #endif // PaintRenderingContext2D_h |
OLD | NEW |