void RenderSVGImage::paint(PaintInfo& paintInfo, int, int) { if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN) return; paintInfo.context->save(); paintInfo.context->concatCTM(localToParentTransform()); if (paintInfo.phase == PaintPhaseForeground) { SVGResourceFilter* filter = 0; PaintInfo savedInfo(paintInfo); if (prepareToRenderSVGContent(this, paintInfo, m_localBounds, filter)) { FloatRect destRect = m_localBounds; FloatRect srcRect(0, 0, image()->width(), image()->height()); SVGImageElement* imageElt = static_cast<SVGImageElement*>(node()); if (imageElt->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE) imageElt->preserveAspectRatio().transformRect(destRect, srcRect); paintInfo.context->drawImage(image(), DeviceColorSpace, destRect, srcRect); } finishRenderSVGContent(this, paintInfo, filter, savedInfo.context); } if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth()) paintOutline(paintInfo.context, 0, 0, width(), height(), style()); paintInfo.context->restore(); }
void RenderSVGContainer::paint(PaintInfo& paintInfo, int parentX, int parentY) { if (paintInfo.context->paintingDisabled() || !drawsContents()) return; // Spec: groups w/o children still may render filter content. if (!firstChild() && !selfWillPaint()) return; paintInfo.context->save(); applyContentTransforms(paintInfo); SVGResourceFilter* filter = 0; PaintInfo savedInfo(paintInfo); FloatRect boundingBox = relativeBBox(true); if (paintInfo.phase == PaintPhaseForeground) prepareToRenderSVGContent(this, paintInfo, boundingBox, filter); applyAdditionalTransforms(paintInfo); // default implementation. Just pass paint through to the children PaintInfo childInfo(paintInfo); childInfo.paintingRoot = paintingRootForChildren(paintInfo); for (RenderObject* child = firstChild(); child; child = child->nextSibling()) child->paint(childInfo, 0, 0); if (paintInfo.phase == PaintPhaseForeground) finishRenderSVGContent(this, paintInfo, boundingBox, filter, savedInfo.context); paintInfo.context->restore(); if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE) paintOutline(paintInfo.context, m_absoluteBounds.x(), m_absoluteBounds.y(), m_absoluteBounds.width(), m_absoluteBounds.height(), style()); }
void RenderPath::paint(PaintInfo& paintInfo, int, int) { if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty()) return; paintInfo.context->save(); paintInfo.context->concatCTM(localToParentTransform()); SVGResourceFilter* filter = 0; FloatRect boundingBox = repaintRectInLocalCoordinates(); if (paintInfo.phase == PaintPhaseForeground) { PaintInfo savedInfo(paintInfo); prepareToRenderSVGContent(this, paintInfo, boundingBox, filter); if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES) paintInfo.context->setShouldAntialias(false); fillAndStrokePath(m_path, paintInfo.context, style(), this); if (static_cast<SVGStyledElement*>(node())->supportsMarkers()) m_markerBounds = drawMarkersIfNeeded(paintInfo.context, paintInfo.rect, m_path); finishRenderSVGContent(this, paintInfo, filter, savedInfo.context); } if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth()) paintOutline(paintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()), static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()), style()); paintInfo.context->restore(); }
void RenderSVGImage::paint(PaintInfo& paintInfo, int, int) { if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN) return; paintInfo.context->save(); paintInfo.context->concatCTM(localTransform()); if (paintInfo.phase == PaintPhaseForeground) { SVGResourceFilter* filter = 0; PaintInfo savedInfo(paintInfo); prepareToRenderSVGContent(this, paintInfo, m_localBounds, filter); FloatRect destRect = m_localBounds; FloatRect srcRect(0, 0, image()->width(), image()->height()); SVGImageElement* imageElt = static_cast<SVGImageElement*>(node()); if (imageElt->preserveAspectRatio()->align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE) adjustRectsForAspectRatio(destRect, srcRect, imageElt->preserveAspectRatio()); paintInfo.context->drawImage(image(), destRect, srcRect); finishRenderSVGContent(this, paintInfo, m_localBounds, filter, savedInfo.context); } paintInfo.context->restore(); }
void RenderPath::paint(PaintInfo& paintInfo, int, int) { if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty()) return; FloatRect boundingBox = repaintRectInLocalCoordinates(); FloatRect nonLocalBoundingBox = m_localTransform.mapRect(boundingBox); if (!nonLocalBoundingBox.intersects(paintInfo.rect)) return; PaintInfo childPaintInfo(paintInfo); bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { childPaintInfo.context->save(); childPaintInfo.applyTransform(m_localTransform); if (childPaintInfo.phase == PaintPhaseForeground) { PaintInfo savedInfo(childPaintInfo); if (SVGRenderSupport::prepareToRenderSVGContent(this, childPaintInfo)) { const SVGRenderStyle* svgStyle = style()->svgStyle(); if (svgStyle->shapeRendering() == SR_CRISPEDGES) childPaintInfo.context->setShouldAntialias(false); fillAndStrokePath(childPaintInfo.context); if (svgStyle->hasMarkers()) m_markerLayoutInfo.drawMarkers(childPaintInfo); } SVGRenderSupport::finishRenderSVGContent(this, childPaintInfo, savedInfo.context); } if (drawsOutline) paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()), static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height())); childPaintInfo.context->restore(); } }
void RenderSVGImage::paint(PaintInfo& paintInfo, int, int) { if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || !m_imageResource->hasImage()) return; FloatRect boundingBox = repaintRectInLocalCoordinates(); if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo)) return; PaintInfo childPaintInfo(paintInfo); bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { childPaintInfo.context->save(); childPaintInfo.applyTransform(m_localTransform); if (childPaintInfo.phase == PaintPhaseForeground) { PaintInfo savedInfo(childPaintInfo); if (SVGRenderSupport::prepareToRenderSVGContent(this, childPaintInfo)) { Image* image = m_imageResource->image(); FloatRect destRect = m_localBounds; FloatRect srcRect(0, 0, image->width(), image->height()); SVGImageElement* imageElement = static_cast<SVGImageElement*>(node()); if (imageElement->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE) imageElement->preserveAspectRatio().transformRect(destRect, srcRect); childPaintInfo.context->drawImage(image, DeviceColorSpace, destRect, srcRect); } SVGRenderSupport::finishRenderSVGContent(this, childPaintInfo, savedInfo.context); } if (drawsOutline) paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()), static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height())); childPaintInfo.context->restore(); } }
void RenderPath::paint(PaintInfo& paintInfo, int, int) { if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty()) return; FloatRect boundingBox = repaintRectInLocalCoordinates(); FloatRect nonLocalBoundingBox = m_localTransform.mapRect(boundingBox); // FIXME: The empty rect check is to deal with incorrect initial clip in renderSubtreeToImage // unfortunately fixing that problem is fairly complex unless we were willing to just futz the // rect to something "close enough" if (!nonLocalBoundingBox.intersects(paintInfo.rect) && !paintInfo.rect.isEmpty()) return; PaintInfo childPaintInfo(paintInfo); childPaintInfo.context->save(); applyTransformToPaintInfo(childPaintInfo, m_localTransform); SVGResourceFilter* filter = 0; if (childPaintInfo.phase == PaintPhaseForeground) { PaintInfo savedInfo(childPaintInfo); if (prepareToRenderSVGContent(this, childPaintInfo, boundingBox, filter)) { if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES) childPaintInfo.context->setShouldAntialias(false); fillAndStrokePath(m_path, childPaintInfo.context, style(), this); if (static_cast<SVGStyledElement*>(node())->supportsMarkers()) m_markerLayoutInfo.drawMarkers(childPaintInfo); } finishRenderSVGContent(this, childPaintInfo, filter, savedInfo.context); } if ((childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth()) paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()), static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()), style()); childPaintInfo.context->restore(); }
void RenderSVGPath::paint(PaintInfo& paintInfo, const IntPoint&) { if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty()) return; FloatRect boundingBox = repaintRectInLocalCoordinates(); if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo)) return; PaintInfo childPaintInfo(paintInfo); bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { GraphicsContextStateSaver stateSaver(*childPaintInfo.context); childPaintInfo.applyTransform(m_localTransform); if (childPaintInfo.phase == PaintPhaseForeground) { PaintInfo savedInfo(childPaintInfo); if (SVGRenderSupport::prepareToRenderSVGContent(this, childPaintInfo)) { const SVGRenderStyle* svgStyle = style()->svgStyle(); if (svgStyle->shapeRendering() == SR_CRISPEDGES) childPaintInfo.context->setShouldAntialias(false); fillAndStrokePath(childPaintInfo.context); if (svgStyle->hasMarkers()) m_markerLayoutInfo.drawMarkers(childPaintInfo); } SVGRenderSupport::finishRenderSVGContent(this, childPaintInfo, savedInfo.context); } if (drawsOutline) paintOutline(childPaintInfo.context, IntRect(boundingBox)); } }
void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat) { LOCK_RECALC_SCROLLBAR = TRUE; NMCLISTCONTROL nm; int i, j; OBJLIST<SavedGroupState_t> savedGroup(4); OBJLIST<SavedContactState_t> savedContact(4); OBJLIST<SavedInfoState_t> savedInfo(4); ClcGroup *group; ClcContact *contact; pcli->pfnHideInfoTip(hwnd, dat); KillTimer(hwnd, TIMERID_INFOTIP); KillTimer(hwnd, TIMERID_RENAME); pcli->pfnEndRename(hwnd, dat, 1); dat->needsResort = 1; group = &dat->list; group->scanIndex = 0; for (;;) { if (group->scanIndex == group->cl.count) { group = group->parent; if (group == NULL) break; } else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { group = group->cl.items[group->scanIndex]->group; group->scanIndex = 0; SavedGroupState_t* p = new SavedGroupState_t; p->groupId = group->groupId; p->expanded = group->expanded; savedGroup.insert(p); continue; } else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) { SavedContactState_t* p = new SavedContactState_t; p->hContact = group->cl.items[group->scanIndex]->hContact; memcpy(p->iExtraImage, group->cl.items[group->scanIndex]->iExtraImage, sizeof(p->iExtraImage)); p->checked = group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED; savedContact.insert(p); } else if (group->cl.items[group->scanIndex]->type == CLCIT_INFO) { SavedInfoState_t *p = new SavedInfoState_t; memset(p, 0, sizeof(SavedInfoState_t)); if (group->parent == NULL) p->parentId = -1; else p->parentId = group->groupId; p->contact = *group->cl.items[group->scanIndex]; savedInfo.insert(p); } group->scanIndex++; } pcli->pfnFreeGroup(&dat->list); pcli->pfnRebuildEntireList(hwnd, dat); group = &dat->list; group->scanIndex = 0; for (;;) { if (group->scanIndex == group->cl.count) { group = group->parent; if (group == NULL) break; } else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { group = group->cl.items[group->scanIndex]->group; group->scanIndex = 0; for (i = 0; i < savedGroup.getCount(); i++) if (savedGroup[i].groupId == group->groupId) { group->expanded = savedGroup[i].expanded; break; } continue; } else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) { for (i = 0; i < savedContact.getCount(); i++) if (savedContact[i].hContact == group->cl.items[group->scanIndex]->hContact) { memcpy(group->cl.items[group->scanIndex]->iExtraImage, savedContact[i].iExtraImage, sizeof(contact->iExtraImage)); if (savedContact[i].checked) group->cl.items[group->scanIndex]->flags |= CONTACTF_CHECKED; break; } } group->scanIndex++; } for (i = 0; i < savedInfo.getCount(); i++) { if (savedInfo[i].parentId == -1) group = &dat->list; else { if (!pcli->pfnFindItem(hwnd, dat, savedInfo[i].parentId | HCONTACT_ISGROUP, &contact, NULL, NULL)) continue; group = contact->group; } j = pcli->pfnAddInfoItemToGroup(group, savedInfo[i].contact.flags, _T("")); *group->cl.items[j] = savedInfo[i].contact; } LOCK_RECALC_SCROLLBAR = FALSE; pcli->pfnRecalculateGroupCheckboxes(hwnd, dat); pcli->pfnRecalcScrollBar(hwnd, dat); nm.hdr.code = CLN_LISTREBUILT; nm.hdr.hwndFrom = hwnd; nm.hdr.idFrom = GetDlgCtrlID(hwnd); SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nm); }