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

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h

Issue 2572873002: Add ColorBehavior plumbing for 2D canvas drawImage (Closed)
Patch Set: Created 4 years 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
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 bool parseColorOrCurrentColor(Color&, const String& colorString) const final; 51 bool parseColorOrCurrentColor(Color&, const String& colorString) const final;
52 52
53 SkCanvas* drawingCanvas() const final; 53 SkCanvas* drawingCanvas() const final;
54 SkCanvas* existingDrawingCanvas() const final; 54 SkCanvas* existingDrawingCanvas() const final;
55 void disableDeferral(DisableDeferralReason) final {} 55 void disableDeferral(DisableDeferralReason) final {}
56 56
57 AffineTransform baseTransform() const final; 57 AffineTransform baseTransform() const final;
58 58
59 void didDraw(const SkIRect& dirtyRect) final; 59 void didDraw(const SkIRect& dirtyRect) final;
60 60
61 ColorBehavior drawImageColorBehavior() const final;
62
61 // TODO(ikilpatrick): We'll need to either only accept resolved filters 63 // TODO(ikilpatrick): We'll need to either only accept resolved filters
62 // from a typed-om <filter> object, or use the appropriate style resolution 64 // from a typed-om <filter> object, or use the appropriate style resolution
63 // host to determine 'em' units etc in filters. At the moment just pretend 65 // host to determine 'em' units etc in filters. At the moment just pretend
64 // that we don't have a filter set. 66 // that we don't have a filter set.
65 bool stateHasFilter() final { return false; } 67 bool stateHasFilter() final { return false; }
66 sk_sp<SkImageFilter> stateGetFilter() final { return nullptr; } 68 sk_sp<SkImageFilter> stateGetFilter() final { return nullptr; }
67 void snapshotStateForFilter() final {} 69 void snapshotStateForFilter() final {}
68 70
69 void validateStateStack() const final; 71 void validateStateStack() const final;
70 72
71 bool hasAlpha() const final { return m_hasAlpha; } 73 bool hasAlpha() const final { return m_hasAlpha; }
72 74
73 // PaintRenderingContext2D cannot lose it's context. 75 // PaintRenderingContext2D cannot lose it's context.
74 bool isContextLost() const final { return false; } 76 bool isContextLost() const final { return false; }
75 77
76 private: 78 private:
77 PaintRenderingContext2D(std::unique_ptr<ImageBuffer>, 79 PaintRenderingContext2D(std::unique_ptr<ImageBuffer>,
78 bool hasAlpha, 80 bool hasAlpha,
79 float zoom); 81 float zoom);
80 82
81 std::unique_ptr<ImageBuffer> m_imageBuffer; 83 std::unique_ptr<ImageBuffer> m_imageBuffer;
82 bool m_hasAlpha; 84 bool m_hasAlpha;
83 }; 85 };
84 86
85 } // namespace blink 87 } // namespace blink
86 88
87 #endif // PaintRenderingContext2D_h 89 #endif // PaintRenderingContext2D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698