| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 kContextWebgl2 = 4, | 82 kContextWebgl2 = 4, |
| 83 kContextImageBitmap = 5, | 83 kContextImageBitmap = 5, |
| 84 kContextTypeCount, | 84 kContextTypeCount, |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 static ContextType ContextTypeFromId(const String& id); | 87 static ContextType ContextTypeFromId(const String& id); |
| 88 static ContextType ResolveContextTypeAliases(ContextType); | 88 static ContextType ResolveContextTypeAliases(ContextType); |
| 89 | 89 |
| 90 HTMLCanvasElement* canvas() const { return canvas_; } | 90 HTMLCanvasElement* canvas() const { return canvas_; } |
| 91 | 91 |
| 92 CanvasColorSpace ColorSpace() const; | |
| 93 WTF::String ColorSpaceAsString() const; | 92 WTF::String ColorSpaceAsString() const; |
| 94 CanvasPixelFormat PixelFormat() const; | |
| 95 WTF::String PixelFormatAsString() const; | 93 WTF::String PixelFormatAsString() const; |
| 96 bool LinearPixelMath() const; | |
| 97 | 94 |
| 98 // The color space in which the the content should be interpreted by the | 95 const CanvasColorParams& color_params() const { return color_params_; } |
| 99 // compositor. This is always defined. | |
| 100 gfx::ColorSpace GfxColorSpace() const; | |
| 101 // The color space that should be used for SkSurface creation. This may | |
| 102 // be nullptr. | |
| 103 sk_sp<SkColorSpace> SkSurfaceColorSpace() const; | |
| 104 SkColorType ColorType() const; | |
| 105 ColorBehavior ColorBehaviorForMediaDrawnToCanvas() const; | 96 ColorBehavior ColorBehaviorForMediaDrawnToCanvas() const; |
| 106 bool SkSurfacesUseColorSpace() const; | |
| 107 | 97 |
| 108 virtual PassRefPtr<Image> GetImage(AccelerationHint, | 98 virtual PassRefPtr<Image> GetImage(AccelerationHint, |
| 109 SnapshotReason) const = 0; | 99 SnapshotReason) const = 0; |
| 110 virtual ImageData* ToImageData(SnapshotReason reason) { return nullptr; } | 100 virtual ImageData* ToImageData(SnapshotReason reason) { return nullptr; } |
| 111 virtual ContextType GetContextType() const = 0; | 101 virtual ContextType GetContextType() const = 0; |
| 112 virtual bool IsComposited() const = 0; | 102 virtual bool IsComposited() const = 0; |
| 113 virtual bool IsAccelerated() const = 0; | 103 virtual bool IsAccelerated() const = 0; |
| 114 virtual bool ShouldAntialias() const { return false; } | 104 virtual bool ShouldAntialias() const { return false; } |
| 115 virtual void SetIsHidden(bool) = 0; | 105 virtual void SetIsHidden(bool) = 0; |
| 116 virtual bool isContextLost() const { return true; } | 106 virtual bool isContextLost() const { return true; } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 HashSet<String> clean_urls_; | 210 HashSet<String> clean_urls_; |
| 221 HashSet<String> dirty_urls_; | 211 HashSet<String> dirty_urls_; |
| 222 CanvasColorParams color_params_; | 212 CanvasColorParams color_params_; |
| 223 CanvasContextCreationAttributes creation_attributes_; | 213 CanvasContextCreationAttributes creation_attributes_; |
| 224 bool finalize_frame_scheduled_ = false; | 214 bool finalize_frame_scheduled_ = false; |
| 225 }; | 215 }; |
| 226 | 216 |
| 227 } // namespace blink | 217 } // namespace blink |
| 228 | 218 |
| 229 #endif | 219 #endif |
| OLD | NEW |