OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkRecordDraw.h" | 8 #include "SkRecordDraw.h" |
9 #include "SkPatchUtils.h" | 9 #include "SkPatchUtils.h" |
10 | 10 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 return this->adjustAndMap(dst, op.paint); | 342 return this->adjustAndMap(dst, op.paint); |
343 } | 343 } |
344 | 344 |
345 Bounds bounds(const DrawPosText& op) const { | 345 Bounds bounds(const DrawPosText& op) const { |
346 const int N = op.paint.countText(op.text, op.byteLength); | 346 const int N = op.paint.countText(op.text, op.byteLength); |
347 if (N == 0) { | 347 if (N == 0) { |
348 return Bounds::MakeEmpty(); | 348 return Bounds::MakeEmpty(); |
349 } | 349 } |
350 | 350 |
351 SkRect dst; | 351 SkRect dst; |
352 dst.set(op.pos, op.paint.countText(op.text, N)); | 352 dst.set(op.pos, N); |
353 AdjustTextForFontMetrics(&dst, op.paint); | 353 AdjustTextForFontMetrics(&dst, op.paint); |
354 return this->adjustAndMap(dst, &op.paint); | 354 return this->adjustAndMap(dst, &op.paint); |
355 } | 355 } |
356 Bounds bounds(const DrawPosTextH& op) const { | 356 Bounds bounds(const DrawPosTextH& op) const { |
357 const int N = op.paint.countText(op.text, op.byteLength); | 357 const int N = op.paint.countText(op.text, op.byteLength); |
358 if (N == 0) { | 358 if (N == 0) { |
359 return Bounds::MakeEmpty(); | 359 return Bounds::MakeEmpty(); |
360 } | 360 } |
361 | 361 |
362 SkScalar left = op.xpos[0], right = op.xpos[0]; | 362 SkScalar left = op.xpos[0], right = op.xpos[0]; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. | 470 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. |
471 SkTDArray<SaveBounds> fSaveStack; | 471 SkTDArray<SaveBounds> fSaveStack; |
472 SkTDArray<unsigned> fControlIndices; | 472 SkTDArray<unsigned> fControlIndices; |
473 }; | 473 }; |
474 | 474 |
475 } // namespace SkRecords | 475 } // namespace SkRecords |
476 | 476 |
477 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { | 477 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { |
478 SkRecords::FillBounds(record, bbh); | 478 SkRecords::FillBounds(record, bbh); |
479 } | 479 } |
OLD | NEW |