OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/paint/paint_op_buffer.h" | 5 #include "cc/paint/paint_op_buffer.h" |
6 | 6 |
7 #include "base/containers/stack_container.h" | 7 #include "base/containers/stack_container.h" |
8 #include "cc/paint/display_item_list.h" | 8 #include "cc/paint/display_item_list.h" |
9 #include "cc/paint/paint_record.h" | 9 #include "cc/paint/paint_record.h" |
10 #include "third_party/skia/include/core/SkAnnotation.h" | 10 #include "third_party/skia/include/core/SkAnnotation.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 static bool g_is_draw_op[kNumOpTypes] = {TYPES(M)}; | 183 static bool g_is_draw_op[kNumOpTypes] = {TYPES(M)}; |
184 #undef M | 184 #undef M |
185 | 185 |
186 #define M(T) \ | 186 #define M(T) \ |
187 static_assert(sizeof(T) <= sizeof(LargestPaintOp), \ | 187 static_assert(sizeof(T) <= sizeof(LargestPaintOp), \ |
188 #T " must be no bigger than LargestPaintOp"); | 188 #T " must be no bigger than LargestPaintOp"); |
189 TYPES(M); | 189 TYPES(M); |
190 #undef M | 190 #undef M |
191 | 191 |
192 #define M(T) \ | 192 #define M(T) \ |
193 static_assert(ALIGNOF(T) <= PaintOpBuffer::PaintOpAlign, \ | 193 static_assert(alignof(T) <= PaintOpBuffer::PaintOpAlign, \ |
194 #T " must have alignment no bigger than PaintOpAlign"); | 194 #T " must have alignment no bigger than PaintOpAlign"); |
195 TYPES(M); | 195 TYPES(M); |
196 #undef M | 196 #undef M |
197 | 197 |
198 #undef TYPES | 198 #undef TYPES |
199 | 199 |
200 SkRect PaintOp::kUnsetRect = {SK_ScalarInfinity, 0, 0, 0}; | 200 SkRect PaintOp::kUnsetRect = {SK_ScalarInfinity, 0, 0, 0}; |
201 | 201 |
202 void AnnotateOp::Raster(const PaintOp* base_op, | 202 void AnnotateOp::Raster(const PaintOp* base_op, |
203 SkCanvas* canvas, | 203 SkCanvas* canvas, |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 return std::make_pair(op, skip); | 837 return std::make_pair(op, skip); |
838 } | 838 } |
839 | 839 |
840 void PaintOpBuffer::ShrinkToFit() { | 840 void PaintOpBuffer::ShrinkToFit() { |
841 if (!used_ || used_ == reserved_) | 841 if (!used_ || used_ == reserved_) |
842 return; | 842 return; |
843 ReallocBuffer(used_); | 843 ReallocBuffer(used_); |
844 } | 844 } |
845 | 845 |
846 } // namespace cc | 846 } // namespace cc |
OLD | NEW |