https://bugs.webkit.org/show_bug.cgi?id=72188
Patch by Ian Vollick <vollick@chromium.org> on 2011-11-14
Reviewed by Darin Fisher.
* public/WebLayerTreeView.h:
* src/WebLayerTreeView.cpp:
(WebKit::WebLayerTreeView::compositeAndReadback):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100217
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-11-14 Ian Vollick <vollick@chromium.org>
+
+ Expose compositeAndReadback in WebLayerTreeView
+ https://bugs.webkit.org/show_bug.cgi?id=72188
+
+ Reviewed by Darin Fisher.
+
+ * public/WebLayerTreeView.h:
+ * src/WebLayerTreeView.cpp:
+ (WebKit::WebLayerTreeView::compositeAndReadback):
+
2011-11-14 Raymond Toy <rtoy@google.com>
Add buffering to handle mismatch between hardware buffer size and webaudio render size
namespace WebKit {
class WebLayer;
class WebLayerTreeViewClient;
+struct WebRect;
struct WebSize;
class WebLayerTreeView {
WEBKIT_EXPORT void setViewportSize(const WebSize&);
WEBKIT_EXPORT WebSize viewportSize() const;
+ // Composites and attempts to read back the result into the provided
+ // buffer. If it wasn't possible, e.g. due to context lost, will return
+ // false. Pixel format is 32bit (RGBA), and the provided buffer must be
+ // large enough contain viewportSize().width() * viewportSize().height()
+ // pixels. The WebLayerTreeView does not assume ownership of the buffer.
+ // The buffer is not modified if the false is returned.
+ WEBKIT_EXPORT bool compositeAndReadback(void *pixels, const WebRect&);
+
#if WEBKIT_IMPLEMENTATION
WebLayerTreeView(const WTF::PassRefPtr<WebCore::CCLayerTreeHost>&);
WebLayerTreeView& operator=(const WTF::PassRefPtr<WebCore::CCLayerTreeHost>&);
#include "WebLayerTreeView.h"
#include "WebLayerTreeViewImpl.h"
+#include "WebRect.h"
#include "WebSize.h"
#include "cc/CCLayerTreeHost.h"
return WebSize(m_private->viewportSize());
}
+bool WebLayerTreeView::compositeAndReadback(void *pixels, const WebRect& rect)
+{
+ return m_private->compositeAndReadback(pixels, rect);
+}
+
WebLayerTreeView::WebLayerTreeView(const PassRefPtr<CCLayerTreeHost>& node)
: m_private(node)
{