Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: webkit/port/platform/graphics/GradientSkia.cpp

Issue 10426: Enable CSS Gradients. (Closed)
Patch Set: fix typo Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/platform/graphics/GradientSkia.cpp
diff --git a/webkit/port/platform/graphics/GradientSkia.cpp b/webkit/port/platform/graphics/GradientSkia.cpp
index b287bde533b37653933b7c6db44c743f7724170b..62ae1edf5af70e1022c58c898a2e6540c6a702b1 100644
--- a/webkit/port/platform/graphics/GradientSkia.cpp
+++ b/webkit/port/platform/graphics/GradientSkia.cpp
@@ -28,7 +28,6 @@
#include "CSSParser.h"
#include "GraphicsContext.h"
-#include "NotImplemented.h"
#include "SkGradientShader.h"
#include "SkiaUtils.h"
@@ -121,6 +120,12 @@ SkShader* Gradient::platformGradient()
fill_stops(m_stops.data(), m_stops.size(), pos, colors);
if (m_radial) {
+ // TODO(mmoss) CSS radial Gradients allow an offset focal point (the
+ // "start circle"), but skia doesn't seem to support that, so this just
+ // ignores m_p0/m_r0 and draws the gradient centered in the "end
+ // circle" (m_p1/m_r1).
+ // See http://webkit.org/blog/175/introducing-css-gradients/ for a
+ // description of the expected behavior.
m_gradient = SkGradientShader::CreateRadial(m_p1,
WebCoreFloatToSkScalar(m_r1), colors, pos,
static_cast<int>(count_used), SkShader::kClamp_TileMode);
@@ -135,8 +140,8 @@ SkShader* Gradient::platformGradient()
void Gradient::fill(GraphicsContext* context, const FloatRect& rect)
{
- // Until this is filled, we don't support CSSGradients
- notImplemented();
+ context->setFillGradient(this);
+ context->fillRect(rect);
}
} // namespace WebCore
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698