summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webcursor.cc
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 18:45:26 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 18:45:26 +0000
commit2b99be2e12968b5d3d4f5818d6a76a8d42d818bc (patch)
tree89d180b90aa94bed3fa0d887bbf44e229b164cdf /webkit/glue/webcursor.cc
parent03f95811129d967c67942cbc8fd20572476c95d7 (diff)
downloadchromium_src-2b99be2e12968b5d3d4f5818d6a76a8d42d818bc.zip
chromium_src-2b99be2e12968b5d3d4f5818d6a76a8d42d818bc.tar.gz
chromium_src-2b99be2e12968b5d3d4f5818d6a76a8d42d818bc.tar.bz2
Custom cursor support.
This is necessary for Google Maps, and also cuts out another NOTIMPLEMENTED(). Review URL: http://codereview.chromium.org/10734 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webcursor.cc')
-rw-r--r--webkit/glue/webcursor.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/webkit/glue/webcursor.cc b/webkit/glue/webcursor.cc
index e001a11..acda43f 100644
--- a/webkit/glue/webcursor.cc
+++ b/webkit/glue/webcursor.cc
@@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "webkit/glue/webcursor.h"
+
#include "config.h"
+#include "NativeImageSkia.h"
#include "PlatformCursor.h"
#undef LOG
#include "base/logging.h"
#include "base/pickle.h"
-#include "webkit/glue/webcursor.h"
WebCursor::WebCursor()
: type_(WebCore::PlatformCursor::typePointer) {
@@ -76,9 +78,23 @@ bool WebCursor::IsEqual(const WebCursor& other) const {
custom_data_ == other.custom_data_;
}
-#if !defined(OS_WIN)
+#if !defined(OS_MACOSX)
+void WebCursor::SetCustomData(WebCore::Image* image) {
+ WebCore::NativeImagePtr image_ptr = image->nativeImageForCurrentFrame();
+ if (!image_ptr)
+ return;
+
+ // Fill custom_data_ directly with the NativeImage pixels.
+ SkAutoLockPixels bitmap_lock(*image_ptr);
+ custom_data_.resize(image_ptr->getSize());
+ memcpy(&custom_data_[0], image_ptr->getPixels(), image_ptr->getSize());
+ custom_size_.set_width(image_ptr->width());
+ custom_size_.set_height(image_ptr->height());
+}
+#else
+// The above code should work on the Mac to but evanm was getting forward
+// declaration errors.
void WebCursor::SetCustomData(WebCore::Image* image) {
- // Please create webcursor_{$platform}.cc for your port.
NOTIMPLEMENTED();
}
#endif