blob: c4a374e7e11fabf16f8225ca459a4ea864d18e2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkSVGAttribute.h"
#include "SkSVGRenderContext.h"
SkSVGPresentationAttributes::SkSVGPresentationAttributes()
: fFillIsSet(false)
, fStrokeIsSet(false) { }
void SkSVGPresentationAttributes::setFill(SkColor c) {
fFill = c;
fFillIsSet = true;
}
void SkSVGPresentationAttributes::setStroke(SkColor c) {
fStroke = c;
fStrokeIsSet = true;
}
void SkSVGPresentationAttributes::applyTo(SkTCopyOnFirstWrite<SkSVGRenderContext>& ctx) const {
if (fFillIsSet) {
ctx.writable()->setFillColor(fFill);
}
if (fStrokeIsSet) {
ctx.writable()->setStrokeColor(fStroke);
}
}
|