[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
eric at webkit.org
eric at webkit.org
Wed Mar 17 17:56:27 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit a22d45f128b1217e4387d89e5909b519fc3e0fa0
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Feb 23 01:12:51 2010 +0000
2010-02-22 Stephan Aßmus <superstippi at gmx.de>
Reviewed by Eric Seidel.
[Haiku] Implement creating and filling platform gradients.
https://bugs.webkit.org/show_bug.cgi?id=34683
Covered by existing tests.
* platform/graphics/Gradient.h:
Typedef PlatformGradient to BGradient
* platform/graphics/haiku/GradientHaiku.cpp:
(WebCore::Gradient::platformDestroy):
Delete the cached BGradient object.
(WebCore::Gradient::platformGradient):
Create a BGradient object according to the type of Gradient.
Return the cached object.
(WebCore::Gradient::fill):
use BView API to fill with the platform gradient.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index aadc3f3..87863c4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,26 @@
Reviewed by Eric Seidel.
+ [Haiku] Implement creating and filling platform gradients.
+ https://bugs.webkit.org/show_bug.cgi?id=34683
+
+ Covered by existing tests.
+
+ * platform/graphics/Gradient.h:
+ Typedef PlatformGradient to BGradient
+ * platform/graphics/haiku/GradientHaiku.cpp:
+ (WebCore::Gradient::platformDestroy):
+ Delete the cached BGradient object.
+ (WebCore::Gradient::platformGradient):
+ Create a BGradient object according to the type of Gradient.
+ Return the cached object.
+ (WebCore::Gradient::fill):
+ use BView API to fill with the platform gradient.
+
+2010-02-22 Stephan Aßmus <superstippi at gmx.de>
+
+ Reviewed by Eric Seidel.
+
Build fix for debug builds of GlyphPageTreeNode.cpp
https://bugs.webkit.org/show_bug.cgi?id=34528
diff --git a/WebCore/platform/graphics/Gradient.h b/WebCore/platform/graphics/Gradient.h
index 8fd8790..471f0a7 100644
--- a/WebCore/platform/graphics/Gradient.h
+++ b/WebCore/platform/graphics/Gradient.h
@@ -59,6 +59,9 @@ typedef cairo_pattern_t* PlatformGradient;
class SkShader;
typedef class SkShader* PlatformGradient;
typedef class SkShader* PlatformPattern;
+#elif PLATFORM(HAIKU)
+class BGradient;
+typedef BGradient* PlatformGradient;
#else
typedef void* PlatformGradient;
#endif
diff --git a/WebCore/platform/graphics/haiku/GradientHaiku.cpp b/WebCore/platform/graphics/haiku/GradientHaiku.cpp
index 469a17f..19a9d91 100644
--- a/WebCore/platform/graphics/haiku/GradientHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GradientHaiku.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2008 Kevin Ollivier <kevino at theolliviers.com> All rights reserved.
* Copyright (C) 2009 Maxime Simon <simon.maxime at theolliviers.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi at gmx.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,26 +28,45 @@
#include "config.h"
#include "Gradient.h"
-#include "CSSParser.h"
-#include "NotImplemented.h"
+#include "GraphicsContext.h"
+#include <GradientLinear.h>
+#include <GradientRadial.h>
+#include <View.h>
namespace WebCore {
void Gradient::platformDestroy()
{
- notImplemented();
+ delete m_gradient;
}
PlatformGradient Gradient::platformGradient()
{
- notImplemented();
- return 0;
+ if (m_gradient)
+ return m_gradient;
+
+ if (m_radial) {
+ // TODO: Support m_r0?
+ m_gradient = new BGradientRadial(m_p0, m_r1);
+ } else
+ m_gradient = new BGradientLinear(m_p0, m_p1);
+ size_t size = m_stops.size();
+ for (size_t i = 0; i < size; i++) {
+ const ColorStop& stop = m_stops[i];
+ rgb_color color;
+ color.red = static_cast<uint8>(stop.red * 255);
+ color.green = static_cast<uint8>(stop.green * 255);
+ color.blue = static_cast<uint8>(stop.blue * 255);
+ color.alpha = static_cast<uint8>(stop.alpha * 255);
+ m_gradient->AddColor(color, stop.stop);
+ }
+ return m_gradient;
}
-void Gradient::fill(GraphicsContext*, const FloatRect&)
+void Gradient::fill(GraphicsContext* context, const FloatRect& rect)
{
- notImplemented();
+ context->platformContext()->FillRect(rect, *m_gradient);
}
} // namespace WebCore
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list