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

Unified Diff: Source/web/WebElement.cpp

Issue 19856004: Adds WebElement::imageContents() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix webkit_test_support in static build, it needs to depend on skia so the SkBitma.h include works Created 7 years, 5 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 | « Source/core/html/HTMLImageElement.cpp ('k') | Source/web/WebNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebElement.cpp
diff --git a/Source/web/WebElement.cpp b/Source/web/WebElement.cpp
index 2dbf4fcde9a9f0b2cf8e55c72d9c385466a23644..c4f5f4dc9df3afa3f5af6a96cb9e0e2b772e8ed0 100644
--- a/Source/web/WebElement.cpp
+++ b/Source/web/WebElement.cpp
@@ -152,6 +152,22 @@ WebRect WebElement::boundsInViewportSpace()
return unwrap<Element>()->boundsInRootViewSpace();
}
+WebImage WebElement::imageContents()
+{
+ if (isNull())
+ return WebImage();
+
+ WebCore::Image* image = unwrap<Element>()->imageContents();
+ if (!image)
+ return WebImage();
+
+ RefPtr<NativeImageSkia> bitmap = image->nativeImageForCurrentFrame();
+ if (!bitmap)
+ return WebImage();
+
+ return bitmap->bitmap();
+}
+
WebElement::WebElement(const PassRefPtr<Element>& elem)
: WebNode(elem)
{
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | Source/web/WebNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698