summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-03 02:11:48 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-03 02:11:48 +0000
commit661eb9d1aa5468b984a92e66937432d881f70427 (patch)
tree81bf2b132ac6c7b05b04598e875552819222bb73 /skia
parent99aa2dbf4962fb1a4a52a3eae9bb51ad3113b7be (diff)
downloadchromium_src-661eb9d1aa5468b984a92e66937432d881f70427.zip
chromium_src-661eb9d1aa5468b984a92e66937432d881f70427.tar.gz
chromium_src-661eb9d1aa5468b984a92e66937432d881f70427.tar.bz2
From agl. Cleaned up version of issue 19046.
POSIX: bitmap data on the wire On Windows, when drawing a given rect in the renderer, we allocate memory for the bitmap, render and send a shared memory handle across IPC. In the browser, we bitblit the shared memory to the backing store and draw it to the screen. In the long term, on Linux, we want the backingstore to be shared with both X and the renderer. The renderer then draws directly to that store, sends an IPC to the browser and the browser sends a message to X to bitblit to the display. Since only cache a few backing stores we'll need messages from the browser to tell the renderer to attach and detatch from shared memory regions as they get created and evicted. In the short term, however, to get something that works, we make a BitmapWireData typedef. This will be a shared memory region on Windows, as before, and on POSIX we'll be sending the bitmap data over the wire. Obviously this'll be pretty slow but it'll work sooner. Review URL: http://codereview.chromium.org/19491 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rwxr-xr-xskia/ext/platform_canvas_mac.cc5
-rwxr-xr-xskia/ext/platform_canvas_mac.h5
-rw-r--r--skia/ext/platform_canvas_win.cc5
-rw-r--r--skia/ext/platform_canvas_win.h2
4 files changed, 17 insertions, 0 deletions
diff --git a/skia/ext/platform_canvas_mac.cc b/skia/ext/platform_canvas_mac.cc
index 4acbaa6..380a78b 100755
--- a/skia/ext/platform_canvas_mac.cc
+++ b/skia/ext/platform_canvas_mac.cc
@@ -76,4 +76,9 @@ SkDevice* PlatformCanvasMac::setBitmapDevice(const SkBitmap&) {
return NULL;
}
+// static
+size_t PlatformCanvasMac::StrideForWidth(unsigned width) {
+ return 4 * width;
+}
+
} // namespace skia
diff --git a/skia/ext/platform_canvas_mac.h b/skia/ext/platform_canvas_mac.h
index 4f7f524..da745f8 100755
--- a/skia/ext/platform_canvas_mac.h
+++ b/skia/ext/platform_canvas_mac.h
@@ -57,6 +57,11 @@ class PlatformCanvasMac : public SkCanvas {
// override of a virtual one.
using SkCanvas::clipRect;
+ // Return the stride (length of a line in bytes) for the given width. Because
+ // we use 32-bits per pixel, this will be roughly 4*width. However, for
+ // alignment reasons we may wish to increase that.
+ static size_t StrideForWidth(unsigned width);
+
protected:
// Creates a device store for use by the canvas. We override this so that
// the device is always our own so we know that we can use GDI operations
diff --git a/skia/ext/platform_canvas_win.cc b/skia/ext/platform_canvas_win.cc
index ed0d6d7..a7d878f 100644
--- a/skia/ext/platform_canvas_win.cc
+++ b/skia/ext/platform_canvas_win.cc
@@ -118,4 +118,9 @@ SkDevice* PlatformCanvasWin::setBitmapDevice(const SkBitmap&) {
return NULL;
}
+// static
+size_t PlatformCanvasWin::StrideForWidth(unsigned width) {
+ return 4 * width;
+}
+
} // namespace skia
diff --git a/skia/ext/platform_canvas_win.h b/skia/ext/platform_canvas_win.h
index 88f9cea..7a8c31e 100644
--- a/skia/ext/platform_canvas_win.h
+++ b/skia/ext/platform_canvas_win.h
@@ -57,6 +57,8 @@ class PlatformCanvasWin : public SkCanvas {
// by the next call to save() or restore().
PlatformDeviceWin& getTopPlatformDevice() const;
+ static size_t StrideForWidth(unsigned width);
+
protected:
// Creates a device store for use by the canvas. We override this so that
// the device is always our own so we know that we can use GDI operations