michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Main header first: michael@0: #include "nsSVGPaintServerFrame.h" michael@0: michael@0: // Keep others in (case-insensitive) order: michael@0: #include "gfxContext.h" michael@0: #include "nsSVGElement.h" michael@0: michael@0: NS_IMPL_FRAMEARENA_HELPERS(nsSVGPaintServerFrame) michael@0: michael@0: bool michael@0: nsSVGPaintServerFrame::SetupPaintServer(gfxContext *aContext, michael@0: nsIFrame *aSource, michael@0: nsStyleSVGPaint nsStyleSVG::*aFillOrStroke, michael@0: float aOpacity) michael@0: { michael@0: nsRefPtr pattern = michael@0: GetPaintServerPattern(aSource, aContext->CurrentMatrix(), aFillOrStroke, michael@0: aOpacity); michael@0: if (!pattern) michael@0: return false; michael@0: michael@0: if (!aContext->IsCairo()) { michael@0: pattern->CacheColorStops(aContext->GetDrawTarget()); michael@0: } michael@0: michael@0: aContext->SetPattern(pattern); michael@0: return true; michael@0: }