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

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

Issue 2018933004: Add offset to memory allocations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix tests Created 4 years, 6 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 if (contentRect.width() > 0 && contentRect.height() > 0) { 248 if (contentRect.width() > 0 && contentRect.height() > 0) {
249 fDefaultMatrix.setRectToRect(slideBounds, contentRect, SkMatrix::kSt art_ScaleToFit); 249 fDefaultMatrix.setRectToRect(slideBounds, contentRect, SkMatrix::kSt art_ScaleToFit);
250 SkAssertResult(fDefaultMatrix.invert(&fDefaultMatrixInv)); 250 SkAssertResult(fDefaultMatrix.invert(&fDefaultMatrixInv));
251 } 251 }
252 } 252 }
253 253
254 if (fWindow->supportsContentRect()) { 254 if (fWindow->supportsContentRect()) {
255 const SkISize slideSize = fSlides[fCurrentSlide]->getDimensions(); 255 const SkISize slideSize = fSlides[fCurrentSlide]->getDimensions();
256 SkRect windowRect = fWindow->getContentRect(); 256 SkRect windowRect = fWindow->getContentRect();
257 fDefaultMatrixInv.mapRect(&windowRect); 257 fDefaultMatrixInv.mapRect(&windowRect);
258 fGesture.setTransLimit(SkRect::MakeWH(slideSize.width(), slideSize.heigh t()), windowRect); 258 fGesture.setTransLimit(SkRect::MakeWH(SkIntToScalar(slideSize.width()),
259 SkIntToScalar(slideSize.height())) ,
260 windowRect);
259 } 261 }
260 262
261 this->updateTitle(); 263 this->updateTitle();
262 this->updateUIState(); 264 this->updateUIState();
263 fSlides[fCurrentSlide]->load(); 265 fSlides[fCurrentSlide]->load();
264 if (previousSlide >= 0) { 266 if (previousSlide >= 0) {
265 fSlides[previousSlide]->unload(); 267 fSlides[previousSlide]->unload();
266 } 268 }
267 fWindow->inval(); 269 fWindow->inval();
268 } 270 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 fCurrentSlide++; 448 fCurrentSlide++;
447 } 449 }
448 if (fCurrentSlide >= fSlides.count()) { 450 if (fCurrentSlide >= fSlides.count()) {
449 fCurrentSlide = previousSlide; 451 fCurrentSlide = previousSlide;
450 SkDebugf("Slide not found: %s", stateValue.c_str()); 452 SkDebugf("Slide not found: %s", stateValue.c_str());
451 } 453 }
452 } else { 454 } else {
453 SkDebugf("Unknown stateName: %s", stateName.c_str()); 455 SkDebugf("Unknown stateName: %s", stateName.c_str());
454 } 456 }
455 } 457 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698