Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1174)

Side by Side Diff: experimental/svg/model/SkSVGRect.cpp

Issue 2222793002: [SVGDom] Add <svg> viewBox support (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: typo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « experimental/svg/model/SkSVGNode.cpp ('k') | experimental/svg/model/SkSVGRenderContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « experimental/svg/model/SkSVGNode.cpp ('k') | experimental/svg/model/SkSVGRenderContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698