From 5debd05d2fd5f898c793b464aa1cfb5020275543 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 23 Jan 2012 11:42:15 +0100 Subject: blitter: Fix the 'solid' detection for the brush in case of fillRect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A default QPainter will set a QBrush with Qt::NoBrush BrushStyle, the current code detects this as a non solid fill and all calls with fillRect and a color will not go through QBlittable. Check for Solid or NoBrush style. Manually verified that a p.fillRect(rect, Qt::red) goes through the accelerated path now. Change-Id: Ie53abf0a7ba349ba70742a94086708aca0beaa37 Based-On: Ic0d98030e94f5d11abbe61628fbf71d1e08219c2 Reviewed-by: Jørgen Lind --- src/gui/painting/qpaintengine_blitter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengine_blitter.cpp b/src/gui/painting/qpaintengine_blitter.cpp index f3a021f..7b6ee50 100644 --- a/src/gui/painting/qpaintengine_blitter.cpp +++ b/src/gui/painting/qpaintengine_blitter.cpp @@ -251,9 +251,9 @@ void QBlitterPaintEnginePrivate::updatePenState(QPainterState *s) void QBlitterPaintEnginePrivate::updateBrushState(QPainterState *s) { - bool solid = qbrush_style(s->brush) == Qt::SolidPattern; + Qt::BrushStyle style = qbrush_style(s->brush); - caps.updateState(STATE_BRUSH_PATTERN, !solid); + caps.updateState(STATE_BRUSH_PATTERN, style > Qt::SolidPattern); caps.updateState(STATE_BRUSH_ALPHA, qbrush_color(s->brush).alpha() < 255); } -- cgit v0.12