From 342f6fa66f6d843fe07d9b6a133656f83c8d62f6 Mon Sep 17 00:00:00 2001 From: caryclark Date: Fri, 25 Mar 2016 14:08:26 -0700 Subject: support gradients and stroke+fill To draw paths that are stroked and filled with a pair of colors, reduce the fill by the width of the stroke. This is implemented with path ops subtracting the resolved stroke shape from the fill shape. This permits rendering the result without requiring an offscreen bitmap. The implementation for stroke+fill requires a new entry into the graphics engine, so a bit was added to device caps for that. Extract the gradient information out of the axial gradient function descriptions, and when possible, use Skia to draw the linear gradient directly. This requires making the function descriptions non-opaque, and adding a bit to device caps for another entry into the graphics engine. BUG= Review URL: https://codereview.chromium.org/1828283002 --- core/fxge/skia/fx_skia_device.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/fxge/skia/fx_skia_device.h') diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 012e370717..8ce7c6c61f 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -128,6 +128,11 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { int alpha_flag = 0, void* pIccTransform = NULL) override; + FX_BOOL DrawShading(CPDF_ShadingPattern* pPattern, + CFX_Matrix* pMatrix, + int alpha, + FX_BOOL bAlphaMode) override; + virtual uint8_t* GetBuffer() const { return m_pAggDriver->GetBuffer(); } void PaintStroke(SkPaint* spaint, const CFX_GraphStateData* pGraphState, -- cgit v1.2.3