Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 14 matching lines...) Expand all Loading... | |
| 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 "third_party/skia/include/core/SkColorSpace.h" | 34 #include "third_party/skia/include/core/SkColorSpace.h" |
| 35 #include "third_party/skia/include/core/SkImageInfo.h" | |
| 35 #include "wtf/HashSet.h" | 36 #include "wtf/HashSet.h" |
| 36 #include "wtf/Noncopyable.h" | 37 #include "wtf/Noncopyable.h" |
| 37 #include "wtf/text/StringHash.h" | 38 #include "wtf/text/StringHash.h" |
| 38 | 39 |
| 39 class SkCanvas; | 40 class SkCanvas; |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class CanvasImageSource; | 44 class CanvasImageSource; |
| 44 class HTMLCanvasElement; | 45 class HTMLCanvasElement; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 static ContextType contextTypeFromId(const String& id); | 81 static ContextType contextTypeFromId(const String& id); |
| 81 static ContextType resolveContextTypeAliases(ContextType); | 82 static ContextType resolveContextTypeAliases(ContextType); |
| 82 | 83 |
| 83 HTMLCanvasElement* canvas() const { return m_canvas; } | 84 HTMLCanvasElement* canvas() const { return m_canvas; } |
| 84 | 85 |
| 85 CanvasColorSpace colorSpace() const { return m_colorSpace; }; | 86 CanvasColorSpace colorSpace() const { return m_colorSpace; }; |
| 86 WTF::String colorSpaceAsString() const; | 87 WTF::String colorSpaceAsString() const; |
| 87 sk_sp<SkColorSpace> skColorSpace() const; | 88 sk_sp<SkColorSpace> skColorSpace() const; |
| 89 SkColorType colorType() const; | |
|
xidachen
2016/10/18 15:40:37
Should we make it more consistent? As we call skCo
Justin Novosad
2016/10/18 17:02:41
In general we should not use sk prefixes in blink.
| |
| 88 | 90 |
| 89 virtual PassRefPtr<Image> getImage(AccelerationHint, | 91 virtual PassRefPtr<Image> getImage(AccelerationHint, |
| 90 SnapshotReason) const = 0; | 92 SnapshotReason) const = 0; |
| 91 virtual ContextType getContextType() const = 0; | 93 virtual ContextType getContextType() const = 0; |
| 92 virtual bool isAccelerated() const { return false; } | 94 virtual bool isAccelerated() const { return false; } |
| 93 virtual bool shouldAntialias() const { return false; } | 95 virtual bool shouldAntialias() const { return false; } |
| 94 virtual void setIsHidden(bool) = 0; | 96 virtual void setIsHidden(bool) = 0; |
| 95 virtual bool isContextLost() const { return true; } | 97 virtual bool isContextLost() const { return true; } |
| 96 virtual void setCanvasGetContextResult(RenderingContext&) { NOTREACHED(); }; | 98 virtual void setCanvasGetContextResult(RenderingContext&) { NOTREACHED(); }; |
| 97 virtual void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) { | 99 virtual void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 Member<OffscreenCanvas> m_offscreenCanvas; | 189 Member<OffscreenCanvas> m_offscreenCanvas; |
| 188 HashSet<String> m_cleanURLs; | 190 HashSet<String> m_cleanURLs; |
| 189 HashSet<String> m_dirtyURLs; | 191 HashSet<String> m_dirtyURLs; |
| 190 CanvasColorSpace m_colorSpace; | 192 CanvasColorSpace m_colorSpace; |
| 191 CanvasContextCreationAttributes m_creationAttributes; | 193 CanvasContextCreationAttributes m_creationAttributes; |
| 192 }; | 194 }; |
| 193 | 195 |
| 194 } // namespace blink | 196 } // namespace blink |
| 195 | 197 |
| 196 #endif | 198 #endif |
| OLD | NEW |