Title: [136167] trunk/Source/WebCore
- Revision
- 136167
- Author
- [email protected]
- Date
- 2012-11-29 14:34:18 -0800 (Thu, 29 Nov 2012)
Log Message
Make LazyDecodingPixelRef inherit from skia::LazyPixelRef so that cc thread can access it
https://bugs.webkit.org/show_bug.cgi?id=103555
Patch by Min Qin <[email protected]> on 2012-11-29
Reviewed by Stephen White.
Expose LazyDecodingPixelRef to the cc thread by inheriting from skia::LazyPixelRef.
No test added for now as impl side paiting is still WIP.
* platform/graphics/chromium/LazyDecodingPixelRef.cpp:
(WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef):
(WebCore::LazyDecodingPixelRef::PrepareToDecode):
(WebCore):
(WebCore::LazyDecodingPixelRef::Decode):
* platform/graphics/chromium/LazyDecodingPixelRef.h:
(LazyDecodingPixelRef):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (136166 => 136167)
--- trunk/Source/WebCore/ChangeLog 2012-11-29 22:26:53 UTC (rev 136166)
+++ trunk/Source/WebCore/ChangeLog 2012-11-29 22:34:18 UTC (rev 136167)
@@ -1,3 +1,21 @@
+2012-11-29 Min Qin <[email protected]>
+
+ Make LazyDecodingPixelRef inherit from skia::LazyPixelRef so that cc thread can access it
+ https://bugs.webkit.org/show_bug.cgi?id=103555
+
+ Reviewed by Stephen White.
+
+ Expose LazyDecodingPixelRef to the cc thread by inheriting from skia::LazyPixelRef.
+ No test added for now as impl side paiting is still WIP.
+
+ * platform/graphics/chromium/LazyDecodingPixelRef.cpp:
+ (WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef):
+ (WebCore::LazyDecodingPixelRef::PrepareToDecode):
+ (WebCore):
+ (WebCore::LazyDecodingPixelRef::Decode):
+ * platform/graphics/chromium/LazyDecodingPixelRef.h:
+ (LazyDecodingPixelRef):
+
2012-11-29 Julien Chaffraix <[email protected]>
Unreviewed build fix.
Modified: trunk/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp (136166 => 136167)
--- trunk/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp 2012-11-29 22:26:53 UTC (rev 136166)
+++ trunk/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp 2012-11-29 22:34:18 UTC (rev 136167)
@@ -34,8 +34,7 @@
namespace WebCore {
LazyDecodingPixelRef::LazyDecodingPixelRef(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkISize& scaledSize, const SkIRect& scaledSubset)
- : SkPixelRef(0)
- , m_frameGenerator(frameGenerator)
+ : m_frameGenerator(frameGenerator)
, m_scaledSize(scaledSize)
, m_scaledSubset(scaledSubset)
, m_lockedCachedImage(0)
@@ -90,4 +89,19 @@
return false;
}
+bool LazyDecodingPixelRef::PrepareToDecode(const LazyPixelRef::PrepareParams& params)
+{
+ MutexLocker lock(m_mutex);
+ // TODO: check if only a particular rect is available in image cache.
+ UNUSED_PARAM(params);
+ return ImageDecodingStore::instance()->lockCompleteCache(m_frameGenerator.get(), m_scaledSize);
+}
+
+void LazyDecodingPixelRef::Decode()
+{
+ lockPixels();
+ unlockPixels();
+}
+
+
} // namespace WebKit
Modified: trunk/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h (136166 => 136167)
--- trunk/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h 2012-11-29 22:26:53 UTC (rev 136166)
+++ trunk/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h 2012-11-29 22:34:18 UTC (rev 136167)
@@ -26,21 +26,24 @@
#ifndef LazyDecodingPixelRef_h
#define LazyDecodingPixelRef_h
-#include "SkTypes.h"
#include "SkFlattenableBuffers.h"
#include "SkPixelRef.h"
#include "SkRect.h"
#include "SkSize.h"
+#include "SkTypes.h"
+#include "skia/ext/lazy_pixel_ref.h"
#include <wtf/RefPtr.h>
#include <wtf/ThreadingPrimitives.h>
+using skia::LazyPixelRef;
+
namespace WebCore {
class ImageFrameGenerator;
class ScaledImageFragment;
-class LazyDecodingPixelRef : public SkPixelRef {
+class LazyDecodingPixelRef : public LazyPixelRef {
public:
LazyDecodingPixelRef(PassRefPtr<ImageFrameGenerator>, const SkISize& scaledSize, const SkIRect& scaledSubset);
virtual ~LazyDecodingPixelRef();
@@ -51,6 +54,9 @@
bool isScaled(const SkISize& fullSize) const;
bool isClipped() const;
+ virtual bool PrepareToDecode(const LazyPixelRef::PrepareParams&);
+ virtual void Decode();
+
protected:
// SkPixelRef implementation.
virtual void* onLockPixels(SkColorTable**);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes