• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2013 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "Paint.h"
18 #include <SkPaint.h>
19 
20 #define LOG_TAG "Paint"
21 #include <cutils/log.h>
22 
23 namespace android {
24 
Paint()25 Paint::Paint() : SkPaint(),
26         mLetterSpacing(0), mFontFeatureSettings(), mTextLocale(), mFontVariant(VARIANT_DEFAULT) {
27 }
28 
Paint(const Paint & paint)29 Paint::Paint(const Paint& paint) : SkPaint(paint),
30         mLetterSpacing(paint.mLetterSpacing), mFontFeatureSettings(paint.mFontFeatureSettings),
31         mTextLocale(paint.mTextLocale), mFontVariant(paint.mFontVariant),
32         mHyphenEdit(paint.mHyphenEdit) {
33 }
34 
~Paint()35 Paint::~Paint() {
36 }
37 
operator =(const Paint & other)38 Paint& Paint::operator=(const Paint& other) {
39     SkPaint::operator=(other);
40     mLetterSpacing = other.mLetterSpacing;
41     mFontFeatureSettings = other.mFontFeatureSettings;
42     mTextLocale = other.mTextLocale;
43     mFontVariant = other.mFontVariant;
44     mHyphenEdit = other.mHyphenEdit;
45     return *this;
46 }
47 
operator ==(const Paint & a,const Paint & b)48 bool operator==(const Paint& a, const Paint& b) {
49     return static_cast<const SkPaint&>(a) == static_cast<const SkPaint&>(b)
50             && a.mLetterSpacing == b.mLetterSpacing
51             && a.mFontFeatureSettings == b.mFontFeatureSettings
52             && a.mTextLocale == b.mTextLocale
53             && a.mFontVariant == b.mFontVariant
54             && a.mHyphenEdit == b.mHyphenEdit;
55 }
56 
57 }
58