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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2249853008: Reject createImageBitmap promise when the cropRect or resize is too big (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update tests Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index f7c810adfff5571870c7598933da21f956035568..597217d7f052d8c319099a8631d94493b8b438c2 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -4525,8 +4525,8 @@ void WebGLRenderingContextBase::texImageHelperImageBitmap(TexImageFunctionID fun
}
RefPtr<SkImage> skImage = bitmap->bitmapImage()->imageForCurrentFrame();
SkPixmap pixmap;
- std::unique_ptr<uint8_t[]> pixelData;
uint8_t* pixelDataPtr = nullptr;
+ RefPtr<Uint8Array> pixelData;
// In the case where an ImageBitmap is not texture backed, peekPixels() always succeed.
// However, when it is texture backed and !canUseTexImageByGPU, we do a GPU read back.
bool peekSucceed = skImage->peekPixels(&pixmap);
@@ -4534,7 +4534,7 @@ void WebGLRenderingContextBase::texImageHelperImageBitmap(TexImageFunctionID fun
pixelDataPtr = static_cast<uint8_t*>(pixmap.writable_addr());
} else {
pixelData = bitmap->copyBitmapData(bitmap->isPremultiplied() ? PremultiplyAlpha : DontPremultiplyAlpha);
- pixelDataPtr = pixelData.get();
+ pixelDataPtr = pixelData->data();
}
Vector<uint8_t> data;
bool needConversion = true;
« no previous file with comments | « third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698