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

Side by Side Diff: samplecode/SampleSVGPong.cpp

Issue 2345533002: [SVGDom] Expose intrinsic size info (Closed)
Patch Set: private intrinsicSize() Created 4 years, 3 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 | « samplecode/SampleSVGFile.cpp ('k') | no next file » | 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkAnimTimer.h" 9 #include "SkAnimTimer.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 root->appendChild(fPaddle0.shadowNode); 129 root->appendChild(fPaddle0.shadowNode);
130 root->appendChild(fPaddle1.shadowNode); 130 root->appendChild(fPaddle1.shadowNode);
131 root->appendChild(fBall.shadowNode); 131 root->appendChild(fBall.shadowNode);
132 root->appendChild(fPaddle0.objectNode); 132 root->appendChild(fPaddle0.objectNode);
133 root->appendChild(fPaddle1.objectNode); 133 root->appendChild(fPaddle1.objectNode);
134 root->appendChild(fBall.objectNode); 134 root->appendChild(fBall.objectNode);
135 135
136 // Handle everything in a normalized 1x1 space. 136 // Handle everything in a normalized 1x1 space.
137 root->setViewBox(SkSVGViewBoxType(SkRect::MakeWH(1, 1))); 137 root->setViewBox(SkSVGViewBoxType(SkRect::MakeWH(1, 1)));
138 138
139 fDom = sk_sp<SkSVGDOM>(new SkSVGDOM(SkSize::Make(this->width(), this->he ight()))); 139 fDom = sk_sp<SkSVGDOM>(new SkSVGDOM());
140 fDom->setContainerSize(SkSize::Make(this->width(), this->height()));
140 fDom->setRoot(std::move(root)); 141 fDom->setRoot(std::move(root));
141 142
142 // Off we go. 143 // Off we go.
143 this->updatePaddleStrategy(); 144 this->updatePaddleStrategy();
144 } 145 }
145 146
146 bool onQuery(SkEvent* evt) override { 147 bool onQuery(SkEvent* evt) override {
147 if (SampleCode::TitleQ(*evt)) { 148 if (SampleCode::TitleQ(*evt)) {
148 SampleCode::TitleR(evt, "SVGPong"); 149 SampleCode::TitleR(evt, "SVGPong");
149 return true; 150 return true;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 SkRandom fRand; 278 SkRandom fRand;
278 279
279 SkMSec fLastTick = 0; 280 SkMSec fLastTick = 0;
280 SkScalar fTimeScale = 1.0f; 281 SkScalar fTimeScale = 1.0f;
281 282
282 typedef SampleView INHERITED; 283 typedef SampleView INHERITED;
283 }; 284 };
284 285
285 static SkView* SVGPongFactory() { return new SVGPongView; } 286 static SkView* SVGPongFactory() { return new SVGPongView; }
286 static SkViewRegister reg(SVGPongFactory); 287 static SkViewRegister reg(SVGPongFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleSVGFile.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698