Flutter Engine
paint_record.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Google Inc.
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_record.h"
18 
19 #include "flutter/fml/logging.h"
20 
21 namespace txt {
22 
23 PaintRecord::~PaintRecord() = default;
24 
26  SkPoint offset,
27  sk_sp<SkTextBlob> text,
28  SkFontMetrics metrics,
29  size_t line,
30  double x_start,
31  double x_end,
32  bool is_ghost)
33  : style_(style),
34  offset_(offset),
35  text_(std::move(text)),
36  metrics_(metrics),
37  line_(line),
38  x_start_(x_start),
39  x_end_(x_end),
40  is_ghost_(is_ghost) {}
41 
43  SkPoint offset,
44  sk_sp<SkTextBlob> text,
45  SkFontMetrics metrics,
46  size_t line,
47  double x_start,
48  double x_end,
49  bool is_ghost,
50  PlaceholderRun* placeholder_run)
51  : style_(style),
52  offset_(offset),
53  text_(std::move(text)),
54  metrics_(metrics),
55  line_(line),
56  x_start_(x_start),
57  x_end_(x_end),
58  is_ghost_(is_ghost),
59  placeholder_run_(placeholder_run) {}
60 
62  sk_sp<SkTextBlob> text,
63  SkFontMetrics metrics,
64  size_t line,
65  double x_start,
66  double x_end,
67  bool is_ghost)
68  : style_(style),
69  text_(std::move(text)),
70  metrics_(metrics),
71  line_(line),
72  x_start_(x_start),
73  x_end_(x_end),
74  is_ghost_(is_ghost) {}
75 
77  style_ = other.style_;
78  offset_ = other.offset_;
79  text_ = std::move(other.text_);
80  metrics_ = other.metrics_;
81  line_ = other.line_;
82  placeholder_run_ = other.placeholder_run_;
83  x_start_ = other.x_start_;
84  x_end_ = other.x_end_;
85  is_ghost_ = other.is_ghost_;
86 }
87 
89  style_ = other.style_;
90  offset_ = other.offset_;
91  text_ = std::move(other.text_);
92  metrics_ = other.metrics_;
93  line_ = other.line_;
94  x_start_ = other.x_start_;
95  x_end_ = other.x_end_;
96  is_ghost_ = other.is_ghost_;
97  placeholder_run_ = other.placeholder_run_;
98  return *this;
99 }
100 
101 void PaintRecord::SetOffset(SkPoint pt) {
102  offset_ = pt;
103 }
104 
105 } // namespace txt
Definition: ref_ptr.h:252
void SetOffset(SkPoint pt)
double x_end() const
Definition: paint_record.h:82
PaintRecord()=delete
PaintRecord & operator=(PaintRecord &&other)
Definition: paint_record.cc:88
const SkFontMetrics & metrics() const
Definition: paint_record.h:75
size_t line() const
Definition: paint_record.h:79
double x_start() const
Definition: paint_record.h:81
SkPoint offset() const
Definition: paint_record.h:69
SkTextBlob * text() const
Definition: paint_record.h:73
const TextStyle & style() const
Definition: paint_record.h:77