Title: [156195] trunk/Source/WebCore
Revision
156195
Author
[email protected]
Date
2013-09-20 13:35:40 -0700 (Fri, 20 Sep 2013)

Log Message

Add an argument to ImageSource::createFrameAtIndex to hint a decoder that we expect a scaled image.
https://bugs.webkit.org/show_bug.cgi?id=121696

Patch by Yongjun Zhang <[email protected]> on 2013-09-20
Reviewed by Antti Koivisto.

Add an argument to ImageSource::createFrameAtIndex.  A platform image decoder can decide the optimal
scale based on the hint and pass the real scale it used for decoding.

No new tests, no behavior change.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::createFrameAtIndex):
* platform/graphics/ImageSource.h:
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::createFrameAtIndex):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156194 => 156195)


--- trunk/Source/WebCore/ChangeLog	2013-09-20 20:27:50 UTC (rev 156194)
+++ trunk/Source/WebCore/ChangeLog	2013-09-20 20:35:40 UTC (rev 156195)
@@ -1,3 +1,21 @@
+2013-09-20  Yongjun Zhang  <[email protected]>
+
+        Add an argument to ImageSource::createFrameAtIndex to hint a decoder that we expect a scaled image.
+        https://bugs.webkit.org/show_bug.cgi?id=121696
+
+        Reviewed by Antti Koivisto.
+
+        Add an argument to ImageSource::createFrameAtIndex.  A platform image decoder can decide the optimal
+        scale based on the hint and pass the real scale it used for decoding.
+
+        No new tests, no behavior change.
+
+        * platform/graphics/ImageSource.cpp:
+        (WebCore::ImageSource::createFrameAtIndex):
+        * platform/graphics/ImageSource.h:
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::createFrameAtIndex):
+
 2013-09-20  Andreas Kling  <[email protected]>
 
         Make JSMainThreadNullState noncopyable.

Modified: trunk/Source/WebCore/platform/graphics/ImageSource.cpp (156194 => 156195)


--- trunk/Source/WebCore/platform/graphics/ImageSource.cpp	2013-09-20 20:27:50 UTC (rev 156194)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.cpp	2013-09-20 20:35:40 UTC (rev 156195)
@@ -136,8 +136,10 @@
     return m_decoder ? m_decoder->frameCount() : 0;
 }
 
-PassNativeImagePtr ImageSource::createFrameAtIndex(size_t index)
+PassNativeImagePtr ImageSource::createFrameAtIndex(size_t index, float* scale)
 {
+    UNUSED_PARAM(scale);
+
     if (!m_decoder)
         return 0;
 

Modified: trunk/Source/WebCore/platform/graphics/ImageSource.h (156194 => 156195)


--- trunk/Source/WebCore/platform/graphics/ImageSource.h	2013-09-20 20:27:50 UTC (rev 156194)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.h	2013-09-20 20:35:40 UTC (rev 156195)
@@ -145,7 +145,7 @@
 
     // Callers should not call this after calling clear() with a higher index;
     // see comments on clear() above.
-    PassNativeImagePtr createFrameAtIndex(size_t);
+    PassNativeImagePtr createFrameAtIndex(size_t, float* scale = 0);
 
     float frameDurationAtIndex(size_t);
     bool frameHasAlphaAtIndex(size_t); // Whether or not the frame actually used any alpha.

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp (156194 => 156195)


--- trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp	2013-09-20 20:27:50 UTC (rev 156194)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp	2013-09-20 20:35:40 UTC (rev 156195)
@@ -291,8 +291,10 @@
     return m_decoder ? CGImageSourceGetCount(m_decoder) : 0;
 }
 
-CGImageRef ImageSource::createFrameAtIndex(size_t index)
+CGImageRef ImageSource::createFrameAtIndex(size_t index, float* scale)
 {
+    UNUSED_PARAM(scale);
+
     if (!initialized())
         return 0;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to