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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 2026803002: Avoid GPU readback in tex(Sub)Image2D(ImageBitmap) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address kbr@'s comments Created 4 years, 6 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
Index: third_party/WebKit/Source/core/html/HTMLImageElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
index 40d8b500bbf176cd06f091ad89b7b9c7f4b4e287..7511b30e3909957401b419099360b25114d6fa16 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -806,6 +806,22 @@ bool HTMLImageElement::isOpaque() const
return image && image->currentFrameKnownToBeOpaque();
}
+int HTMLImageElement::sourceWidth()
+{
+ SourceImageStatus status;
+ FloatSize defaultObjectSize(width(), height());
+ RefPtr<Image> image = getSourceImageForCanvas(&status, PreferNoAcceleration, SnapshotReasonCopyToWebGLTexture, defaultObjectSize);
+ return image->width();
+}
+
+int HTMLImageElement::sourceHeight()
+{
+ SourceImageStatus status;
+ FloatSize defaultObjectSize(width(), height());
+ RefPtr<Image> image = getSourceImageForCanvas(&status, PreferNoAcceleration, SnapshotReasonCopyToWebGLTexture, defaultObjectSize);
+ return image->height();
+}
+
IntSize HTMLImageElement::bitmapSourceSize() const
{
ImageResource* image = cachedImage();
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLImageElement.h ('k') | third_party/WebKit/Source/core/html/HTMLVideoElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698