2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-03-26 04:58:59 -07:00
|
|
|
// Main header first:
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSVGPaintServerFrame.h"
|
2012-03-26 04:58:59 -07:00
|
|
|
|
|
|
|
// Keep others in (case-insensitive) order:
|
2013-10-01 14:02:16 -07:00
|
|
|
#include "gfxContext.h"
|
2012-05-18 01:34:25 -07:00
|
|
|
#include "nsSVGElement.h"
|
2009-09-12 09:49:24 -07:00
|
|
|
|
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsSVGPaintServerFrame)
|
2010-07-01 09:40:30 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2010-07-01 09:40:30 -07:00
|
|
|
nsSVGPaintServerFrame::SetupPaintServer(gfxContext *aContext,
|
2012-08-05 12:10:21 -07:00
|
|
|
nsIFrame *aSource,
|
2012-05-18 01:34:25 -07:00
|
|
|
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
2010-07-01 09:40:30 -07:00
|
|
|
float aOpacity)
|
|
|
|
{
|
2012-07-13 16:18:38 -07:00
|
|
|
nsRefPtr<gfxPattern> pattern =
|
|
|
|
GetPaintServerPattern(aSource, aContext->CurrentMatrix(), aFillOrStroke,
|
|
|
|
aOpacity);
|
2010-07-01 09:40:30 -07:00
|
|
|
if (!pattern)
|
2011-10-17 07:59:28 -07:00
|
|
|
return false;
|
2010-07-01 09:40:30 -07:00
|
|
|
|
2013-11-07 20:50:39 -08:00
|
|
|
if (!aContext->IsCairo()) {
|
|
|
|
pattern->CacheColorStops(aContext->GetDrawTarget());
|
|
|
|
}
|
|
|
|
|
2010-07-01 09:40:30 -07:00
|
|
|
aContext->SetPattern(pattern);
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2010-07-01 09:40:30 -07:00
|
|
|
}
|