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

Side by Side Diff: samplecode/SampleShadowing.cpp

Issue 2245923002: Moved "drawShadowedPicture" call outside of if cases in onDrawContent (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: 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 | « no previous file | 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 "SkPictureRecorder.h" 9 #include "SkPictureRecorder.h"
10 #include "SkShadowPaintFilterCanvas.h" 10 #include "SkShadowPaintFilterCanvas.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 fPicture = this->makeTestPicture(kWidth, kHeight); 109 fPicture = this->makeTestPicture(kWidth, kHeight);
110 } 110 }
111 111
112 if (fSceneChanged || fLightsChanged || fClearShadowMaps) { 112 if (fSceneChanged || fLightsChanged || fClearShadowMaps) {
113 for (int i = 0; i < fLights->numLights(); i++) { 113 for (int i = 0; i < fLights->numLights(); i++) {
114 fLights->light(i).setShadowMap(nullptr); 114 fLights->light(i).setShadowMap(nullptr);
115 } 115 }
116 fSceneChanged = false; 116 fSceneChanged = false;
117 fLightsChanged = false; 117 fLightsChanged = false;
118 fClearShadowMaps = false; 118 fClearShadowMaps = false;
119 }
119 120
120 canvas->setLights(fLights); 121 canvas->setLights(fLights);
121 canvas->drawShadowedPicture(fPicture, nullptr, nullptr); 122 canvas->drawShadowedPicture(fPicture, nullptr, nullptr);
122 }
123 } 123 }
124 124
125 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove rride { 125 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove rride {
126 return new SkView::Click(this); 126 return new SkView::Click(this);
127 } 127 }
128 128
129 bool onClick(Click *click) override { 129 bool onClick(Click *click) override {
130 SkScalar x = click->fCurr.fX; 130 SkScalar x = click->fCurr.fX;
131 SkScalar y = click->fCurr.fY; 131 SkScalar y = click->fCurr.fY;
132 132
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 sk_sp<SkLights> fLights; 211 sk_sp<SkLights> fLights;
212 212
213 typedef SampleView INHERITED; 213 typedef SampleView INHERITED;
214 }; 214 };
215 215
216 ////////////////////////////////////////////////////////////////////////////// 216 //////////////////////////////////////////////////////////////////////////////
217 static SkView* MyFactory() { return new ShadowingView; } 217 static SkView* MyFactory() { return new ShadowingView; }
218 static SkViewRegister reg(MyFactory); 218 static SkViewRegister reg(MyFactory);
219 219
220 #endif 220 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698