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

Side by Side Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef CanvasRenderingContext_h 26 #ifndef CanvasRenderingContext_h
27 #define CanvasRenderingContext_h 27 #define CanvasRenderingContext_h
28 28
29 #include "core/CoreExport.h" 29 #include "core/CoreExport.h"
30 #include "core/html/HTMLCanvasElement.h" 30 #include "core/html/HTMLCanvasElement.h"
31 #include "core/html/canvas/CanvasContextCreationAttributes.h" 31 #include "core/html/canvas/CanvasContextCreationAttributes.h"
32 #include "core/layout/HitTestCanvasResult.h" 32 #include "core/layout/HitTestCanvasResult.h"
33 #include "core/offscreencanvas/OffscreenCanvas.h" 33 #include "core/offscreencanvas/OffscreenCanvas.h"
34 #include "platform/graphics/ColorBehavior.h"
34 #include "third_party/skia/include/core/SkColorSpace.h" 35 #include "third_party/skia/include/core/SkColorSpace.h"
35 #include "third_party/skia/include/core/SkImageInfo.h" 36 #include "third_party/skia/include/core/SkImageInfo.h"
36 #include "wtf/HashSet.h" 37 #include "wtf/HashSet.h"
37 #include "wtf/Noncopyable.h" 38 #include "wtf/Noncopyable.h"
38 #include "wtf/text/StringHash.h" 39 #include "wtf/text/StringHash.h"
39 40
40 class SkCanvas; 41 class SkCanvas;
41 42
42 namespace blink { 43 namespace blink {
43 44
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 static ContextType contextTypeFromId(const String& id); 82 static ContextType contextTypeFromId(const String& id);
82 static ContextType resolveContextTypeAliases(ContextType); 83 static ContextType resolveContextTypeAliases(ContextType);
83 84
84 HTMLCanvasElement* canvas() const { return m_canvas; } 85 HTMLCanvasElement* canvas() const { return m_canvas; }
85 86
86 CanvasColorSpace colorSpace() const { return m_colorSpace; }; 87 CanvasColorSpace colorSpace() const { return m_colorSpace; };
87 WTF::String colorSpaceAsString() const; 88 WTF::String colorSpaceAsString() const;
88 sk_sp<SkColorSpace> skColorSpace() const; 89 sk_sp<SkColorSpace> skColorSpace() const;
89 SkColorType colorType() const; 90 SkColorType colorType() const;
91 ColorBehavior colorBehaviorForMediaDrawnToCanvas() const;
90 92
91 virtual PassRefPtr<Image> getImage(AccelerationHint, 93 virtual PassRefPtr<Image> getImage(AccelerationHint,
92 SnapshotReason) const = 0; 94 SnapshotReason) const = 0;
93 virtual ImageData* toImageData(SnapshotReason reason) const { 95 virtual ImageData* toImageData(SnapshotReason reason) const {
94 return nullptr; 96 return nullptr;
95 } 97 }
96 virtual ContextType getContextType() const = 0; 98 virtual ContextType getContextType() const = 0;
97 virtual bool isAccelerated() const { return false; } 99 virtual bool isAccelerated() const { return false; }
98 virtual bool shouldAntialias() const { return false; } 100 virtual bool shouldAntialias() const { return false; }
99 virtual void setIsHidden(bool) = 0; 101 virtual void setIsHidden(bool) = 0;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 Member<OffscreenCanvas> m_offscreenCanvas; 192 Member<OffscreenCanvas> m_offscreenCanvas;
191 HashSet<String> m_cleanURLs; 193 HashSet<String> m_cleanURLs;
192 HashSet<String> m_dirtyURLs; 194 HashSet<String> m_dirtyURLs;
193 CanvasColorSpace m_colorSpace; 195 CanvasColorSpace m_colorSpace;
194 CanvasContextCreationAttributes m_creationAttributes; 196 CanvasContextCreationAttributes m_creationAttributes;
195 }; 197 };
196 198
197 } // namespace blink 199 } // namespace blink
198 200
199 #endif 201 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698