OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkRect.h" | 9 #include "SkRect.h" |
10 #include "SkSVGRect.h" | 10 #include "SkSVGRect.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 this->setHeight(*h); | 51 this->setHeight(*h); |
52 } | 52 } |
53 break; | 53 break; |
54 default: | 54 default: |
55 this->INHERITED::onSetAttribute(attr, v); | 55 this->INHERITED::onSetAttribute(attr, v); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 void SkSVGRect::onDraw(SkCanvas* canvas, const SkSVGLengthContext& lctx, | 59 void SkSVGRect::onDraw(SkCanvas* canvas, const SkSVGLengthContext& lctx, |
60 const SkPaint& paint) const { | 60 const SkPaint& paint) const { |
61 const SkRect r = SkRect::MakeXYWH( | 61 canvas->drawRect(lctx.resolveRect(fX, fY, fWidth, fHeight), paint); |
62 lctx.resolve(fX, SkSVGLengthContext::LengthType::kHorizontal), | |
63 lctx.resolve(fY, SkSVGLengthContext::LengthType::kVertical), | |
64 lctx.resolve(fWidth, SkSVGLengthContext::LengthType::kHorizontal), | |
65 lctx.resolve(fHeight, SkSVGLengthContext::LengthType::kVertical)); | |
66 | |
67 canvas->drawRect(r, paint); | |
68 } | 62 } |
OLD | NEW |