Title: [128803] trunk/Source/Platform
- Revision
- 128803
- Author
- [email protected]
- Date
- 2012-09-17 14:04:56 -0700 (Mon, 17 Sep 2012)
Log Message
[chromium] WebCompositorOutputSurface software API
https://bugs.webkit.org/show_bug.cgi?id=96851
Reviewed by James Robinson.
This adds a software-based output option to
WebCompositorOutputSurface, for use with the new software compositor.
If returns a "tear-off" which provides a WebImage object that can be
written to or read.
* Platform.gypi:
* chromium/public/WebCompositorOutputSurface.h:
(WebKit):
(WebCompositorOutputSurface):
(WebKit::WebCompositorOutputSurface::surfaceSoftware):
* chromium/public/WebCompositorOutputSurfaceSoftware.h: Added.
(WebKit):
(WebCompositorOutputSurfaceSoftware):
(WebKit::WebCompositorOutputSurfaceSoftware::~WebCompositorOutputSurfaceSoftware):
Modified Paths
Added Paths
Diff
Modified: trunk/Source/Platform/ChangeLog (128802 => 128803)
--- trunk/Source/Platform/ChangeLog 2012-09-17 20:56:39 UTC (rev 128802)
+++ trunk/Source/Platform/ChangeLog 2012-09-17 21:04:56 UTC (rev 128803)
@@ -1,3 +1,25 @@
+2012-09-17 Alexandre Elias <[email protected]>
+
+ [chromium] WebCompositorOutputSurface software API
+ https://bugs.webkit.org/show_bug.cgi?id=96851
+
+ Reviewed by James Robinson.
+
+ This adds a software-based output option to
+ WebCompositorOutputSurface, for use with the new software compositor.
+ If returns a "tear-off" which provides a WebImage object that can be
+ written to or read.
+
+ * Platform.gypi:
+ * chromium/public/WebCompositorOutputSurface.h:
+ (WebKit):
+ (WebCompositorOutputSurface):
+ (WebKit::WebCompositorOutputSurface::surfaceSoftware):
+ * chromium/public/WebCompositorOutputSurfaceSoftware.h: Added.
+ (WebKit):
+ (WebCompositorOutputSurfaceSoftware):
+ (WebKit::WebCompositorOutputSurfaceSoftware::~WebCompositorOutputSurfaceSoftware):
+
2012-09-14 Dana Jansens <[email protected]>
[chromium] Add the ubercomp WebDelegatedRendererLayer
Modified: trunk/Source/Platform/Platform.gypi (128802 => 128803)
--- trunk/Source/Platform/Platform.gypi 2012-09-17 20:56:39 UTC (rev 128802)
+++ trunk/Source/Platform/Platform.gypi 2012-09-17 21:04:56 UTC (rev 128803)
@@ -46,6 +46,7 @@
'chromium/public/WebCommon.h',
'chromium/public/WebCompositor.h',
'chromium/public/WebCompositorSupport.h',
+ 'chromium/public/WebCompositorSoftwareOutputDevice.h',
'chromium/public/WebCompositorOutputSurface.h',
'chromium/public/WebCompositorOutputSurfaceClient.h',
'chromium/public/WebContentLayer.h',
Modified: trunk/Source/Platform/chromium/public/WebCompositorOutputSurface.h (128802 => 128803)
--- trunk/Source/Platform/chromium/public/WebCompositorOutputSurface.h 2012-09-17 20:56:39 UTC (rev 128802)
+++ trunk/Source/Platform/chromium/public/WebCompositorOutputSurface.h 2012-09-17 21:04:56 UTC (rev 128803)
@@ -30,6 +30,7 @@
class WebCompositorFrame;
class WebGraphicsContext3D;
+class WebCompositorSoftwareOutputDevice;
class WebCompositorOutputSurfaceClient;
// Represents the output surface for a compositor. The compositor owns
@@ -59,14 +60,14 @@
virtual const Capabilities& capabilities() const = 0;
- // Obtains the context associated with this output surface. In the event of a lost context, the
- // entire output surface should be recreated.
+ // Obtain the 3d context or the software device associated with this output surface. Either of these may return a null pointer, but not both.
+ // In the event of a lost context, the entire output surface should be recreated.
virtual WebGraphicsContext3D* context3D() const = 0;
+ virtual WebCompositorSoftwareOutputDevice* softwareDevice() const { return 0; }
// Sends frame data to the parent compositor. This should only be called
// when capabilities().hasParentCompositor.
virtual void sendFrameToParentCompositor(const WebCompositorFrame&) = 0;
-
};
}
Added: trunk/Source/Platform/chromium/public/WebCompositorSoftwareOutputDevice.h (0 => 128803)
--- trunk/Source/Platform/chromium/public/WebCompositorSoftwareOutputDevice.h (rev 0)
+++ trunk/Source/Platform/chromium/public/WebCompositorSoftwareOutputDevice.h 2012-09-17 21:04:56 UTC (rev 128803)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebCompositorSoftwareOutputDevice_h
+#define WebCompositorSoftwareOutputDevice_h
+
+namespace WebKit {
+
+class WebImage;
+class WebSize;
+
+// This is a "tear-off" class providing software drawing support to
+// WebCompositorOutputSurface, such as to a platform-provided window
+// framebuffer.
+class WebCompositorSoftwareOutputDevice {
+public:
+ virtual ~WebCompositorSoftwareOutputDevice() { }
+
+ // Lock the framebuffer and return a pointer to a WebImage referring to its
+ // pixels. Set forWrite if you intend to change the pixels. Readback
+ // is supported whether or not forWrite is set.
+ virtual WebImage* lock(bool forWrite) = 0;
+ virtual void unlock() = 0;
+
+ virtual void didChangeViewportSize(WebSize) = 0;
+};
+
+}
+
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes