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

Side by Side Diff: tools/viewer/Viewer.cpp

Issue 2003653002: Use SkASSERTResult to avoid unused local variables (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Name Created 4 years, 7 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
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 "Viewer.h" 8 #include "Viewer.h"
9 9
10 #include "GMSlide.h" 10 #include "GMSlide.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 fGesture.reset(); 216 fGesture.reset();
217 fDefaultMatrix.reset(); 217 fDefaultMatrix.reset();
218 fDefaultMatrixInv.reset(); 218 fDefaultMatrixInv.reset();
219 219
220 if (fWindow->supportsContentRect() && fWindow->scaleContentToFit()) { 220 if (fWindow->supportsContentRect() && fWindow->scaleContentToFit()) {
221 const SkRect contentRect = fWindow->getContentRect(); 221 const SkRect contentRect = fWindow->getContentRect();
222 const SkISize slideSize = fSlides[fCurrentSlide]->getDimensions(); 222 const SkISize slideSize = fSlides[fCurrentSlide]->getDimensions();
223 const SkRect slideBounds = SkRect::MakeIWH(slideSize.width(), slideSize. height()); 223 const SkRect slideBounds = SkRect::MakeIWH(slideSize.width(), slideSize. height());
224 if (contentRect.width() > 0 && contentRect.height() > 0) { 224 if (contentRect.width() > 0 && contentRect.height() > 0) {
225 fDefaultMatrix.setRectToRect(slideBounds, contentRect, SkMatrix::kSt art_ScaleToFit); 225 fDefaultMatrix.setRectToRect(slideBounds, contentRect, SkMatrix::kSt art_ScaleToFit);
226 bool inverted = fDefaultMatrix.invert(&fDefaultMatrixInv); 226 SkAssertResult(fDefaultMatrix.invert(&fDefaultMatrixInv));
227 SkASSERT(inverted);
228 } 227 }
229 } 228 }
230 229
231 if (fWindow->supportsContentRect()) { 230 if (fWindow->supportsContentRect()) {
232 const SkISize slideSize = fSlides[fCurrentSlide]->getDimensions(); 231 const SkISize slideSize = fSlides[fCurrentSlide]->getDimensions();
233 SkRect windowRect = fWindow->getContentRect(); 232 SkRect windowRect = fWindow->getContentRect();
234 fDefaultMatrixInv.mapRect(&windowRect); 233 fDefaultMatrixInv.mapRect(&windowRect);
235 fGesture.setTransLimit(SkRect::MakeWH(slideSize.width(), slideSize.heigh t()), windowRect); 234 fGesture.setTransLimit(SkRect::MakeWH(slideSize.width(), slideSize.heigh t()), windowRect);
236 } 235 }
237 236
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // Record measurements 375 // Record measurements
377 fMeasurements[fCurrentMeasurement++] = ms; 376 fMeasurements[fCurrentMeasurement++] = ms;
378 fCurrentMeasurement &= (kMeasurementCount - 1); // fast mod 377 fCurrentMeasurement &= (kMeasurementCount - 1); // fast mod
379 SkASSERT(fCurrentMeasurement < kMeasurementCount); 378 SkASSERT(fCurrentMeasurement < kMeasurementCount);
380 379
381 fAnimTimer.updateTime(); 380 fAnimTimer.updateTime();
382 if (fSlides[fCurrentSlide]->animate(fAnimTimer) || fDisplayStats) { 381 if (fSlides[fCurrentSlide]->animate(fAnimTimer) || fDisplayStats) {
383 fWindow->inval(); 382 fWindow->inval();
384 } 383 }
385 } 384 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698