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

Side by Side Diff: third_party/WebKit/Source/core/frame/ImageBitmap.h

Issue 2522693002: Color correct ImageBitmap(HTMLImageElement*) constructor (Closed)
Patch Set: Addressing crash on memory sanitizer trybot 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 ImageBitmap_h 5 #ifndef ImageBitmap_h
6 #define ImageBitmap_h 6 #define ImageBitmap_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/CoreExport.h" 9 #include "core/CoreExport.h"
10 #include "core/html/HTMLImageElement.h" 10 #include "core/html/HTMLImageElement.h"
(...skipping 16 matching lines...) Expand all
27 class ImageDecoder; 27 class ImageDecoder;
28 28
29 enum AlphaDisposition { 29 enum AlphaDisposition {
30 PremultiplyAlpha, 30 PremultiplyAlpha,
31 DontPremultiplyAlpha, 31 DontPremultiplyAlpha,
32 }; 32 };
33 enum DataColorFormat { 33 enum DataColorFormat {
34 RGBAColorType, 34 RGBAColorType,
35 N32ColorType, 35 N32ColorType,
36 }; 36 };
37 enum ColorSpaceInfoUpdate {
38 UpdateColorSpaceInformation,
39 DontUpdateColorSpaceInformation,
40 };
37 41
38 class CORE_EXPORT ImageBitmap final 42 class CORE_EXPORT ImageBitmap final
39 : public GarbageCollectedFinalized<ImageBitmap>, 43 : public GarbageCollectedFinalized<ImageBitmap>,
40 public ScriptWrappable, 44 public ScriptWrappable,
41 public CanvasImageSource, 45 public CanvasImageSource,
42 public ImageBitmapSource { 46 public ImageBitmapSource {
43 DEFINE_WRAPPERTYPEINFO(); 47 DEFINE_WRAPPERTYPEINFO();
44 48
45 public: 49 public:
46 static ImageBitmap* create(HTMLImageElement*, 50 static ImageBitmap* create(HTMLImageElement*,
(...skipping 20 matching lines...) Expand all
67 // This function is called by structured-cloning an ImageBitmap. 71 // This function is called by structured-cloning an ImageBitmap.
68 // isImageBitmapPremultiplied indicates whether the original ImageBitmap is 72 // isImageBitmapPremultiplied indicates whether the original ImageBitmap is
69 // premultiplied or not. 73 // premultiplied or not.
70 // isImageBitmapOriginClean indicates whether the original ImageBitmap is 74 // isImageBitmapOriginClean indicates whether the original ImageBitmap is
71 // origin clean or not. 75 // origin clean or not.
72 static ImageBitmap* create(const void* pixelData, 76 static ImageBitmap* create(const void* pixelData,
73 uint32_t width, 77 uint32_t width,
74 uint32_t height, 78 uint32_t height,
75 bool isImageBitmapPremultiplied, 79 bool isImageBitmapPremultiplied,
76 bool isImageBitmapOriginClean); 80 bool isImageBitmapOriginClean);
77 static sk_sp<SkImage> getSkImageFromDecoder(std::unique_ptr<ImageDecoder>); 81 static sk_sp<SkImage> getSkImageFromDecoder(
82 std::unique_ptr<ImageDecoder>,
83 SkColorType* decodedColorType = nullptr,
84 sk_sp<SkColorSpace>* decodedColorSpace = nullptr,
85 ColorSpaceInfoUpdate = DontUpdateColorSpaceInformation);
78 static bool isResizeOptionValid(const ImageBitmapOptions&, ExceptionState&); 86 static bool isResizeOptionValid(const ImageBitmapOptions&, ExceptionState&);
79 static bool isSourceSizeValid(int sourceWidth, 87 static bool isSourceSizeValid(int sourceWidth,
80 int sourceHeight, 88 int sourceHeight,
81 ExceptionState&); 89 ExceptionState&);
82 90
83 // Type and helper function required by CallbackPromiseAdapter: 91 // Type and helper function required by CallbackPromiseAdapter:
84 using WebType = sk_sp<SkImage>; 92 using WebType = sk_sp<SkImage>;
85 static ImageBitmap* take(ScriptPromiseResolver*, sk_sp<SkImage>); 93 static ImageBitmap* take(ScriptPromiseResolver*, sk_sp<SkImage>);
86 94
87 StaticBitmapImage* bitmapImage() const { 95 StaticBitmapImage* bitmapImage() const {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 bool isImageBitmapPremultiplied, 156 bool isImageBitmapPremultiplied,
149 bool isImageBitmapOriginClean); 157 bool isImageBitmapOriginClean);
150 158
151 RefPtr<StaticBitmapImage> m_image; 159 RefPtr<StaticBitmapImage> m_image;
152 bool m_isNeutered = false; 160 bool m_isNeutered = false;
153 }; 161 };
154 162
155 } // namespace blink 163 } // namespace blink
156 164
157 #endif // ImageBitmap_h 165 #endif // ImageBitmap_h
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698