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

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

Issue 2522693002: Color correct ImageBitmap(HTMLImageElement*) constructor (Closed)
Patch Set: Minor correctinos 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // This function is called by structured-cloning an ImageBitmap. 67 // This function is called by structured-cloning an ImageBitmap.
68 // isImageBitmapPremultiplied indicates whether the original ImageBitmap is 68 // isImageBitmapPremultiplied indicates whether the original ImageBitmap is
69 // premultiplied or not. 69 // premultiplied or not.
70 // isImageBitmapOriginClean indicates whether the original ImageBitmap is 70 // isImageBitmapOriginClean indicates whether the original ImageBitmap is
71 // origin clean or not. 71 // origin clean or not.
72 static ImageBitmap* create(const void* pixelData, 72 static ImageBitmap* create(const void* pixelData,
73 uint32_t width, 73 uint32_t width,
74 uint32_t height, 74 uint32_t height,
75 bool isImageBitmapPremultiplied, 75 bool isImageBitmapPremultiplied,
76 bool isImageBitmapOriginClean); 76 bool isImageBitmapOriginClean);
77 static sk_sp<SkImage> getSkImageFromDecoder(std::unique_ptr<ImageDecoder>); 77 static sk_sp<SkImage> getSkImageFromDecoder(std::unique_ptr<ImageDecoder>,
78 SkColorType* = nullptr,
79 sk_sp<SkColorSpace> = nullptr,
80 bool = false);
78 static bool isResizeOptionValid(const ImageBitmapOptions&, ExceptionState&); 81 static bool isResizeOptionValid(const ImageBitmapOptions&, ExceptionState&);
79 static bool isSourceSizeValid(int sourceWidth, 82 static bool isSourceSizeValid(int sourceWidth,
80 int sourceHeight, 83 int sourceHeight,
81 ExceptionState&); 84 ExceptionState&);
82 85
83 // Type and helper function required by CallbackPromiseAdapter: 86 // Type and helper function required by CallbackPromiseAdapter:
84 using WebType = sk_sp<SkImage>; 87 using WebType = sk_sp<SkImage>;
85 static ImageBitmap* take(ScriptPromiseResolver*, sk_sp<SkImage>); 88 static ImageBitmap* take(ScriptPromiseResolver*, sk_sp<SkImage>);
86 89
87 StaticBitmapImage* bitmapImage() const { 90 StaticBitmapImage* bitmapImage() const {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 bool isImageBitmapPremultiplied, 151 bool isImageBitmapPremultiplied,
149 bool isImageBitmapOriginClean); 152 bool isImageBitmapOriginClean);
150 153
151 RefPtr<StaticBitmapImage> m_image; 154 RefPtr<StaticBitmapImage> m_image;
152 bool m_isNeutered = false; 155 bool m_isNeutered = false;
153 }; 156 };
154 157
155 } // namespace blink 158 } // namespace blink
156 159
157 #endif // ImageBitmap_h 160 #endif // ImageBitmap_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698