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

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

Issue 2064863002: Quickly fix 0f to 0.0f (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« 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 "Viewer.h" 8 #include "Viewer.h"
9 9
10 #include "GMSlide.h" 10 #include "GMSlide.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 void Viewer::drawSlide(SkCanvas* canvas, bool inSplitScreen) { 344 void Viewer::drawSlide(SkCanvas* canvas, bool inSplitScreen) {
345 SkASSERT(!inSplitScreen || fWindow->supportsContentRect()); 345 SkASSERT(!inSplitScreen || fWindow->supportsContentRect());
346 346
347 int count = canvas->save(); 347 int count = canvas->save();
348 348
349 if (fWindow->supportsContentRect()) { 349 if (fWindow->supportsContentRect()) {
350 SkRect contentRect = fWindow->getContentRect(); 350 SkRect contentRect = fWindow->getContentRect();
351 // If inSplitScreen, translate the image half screen to the right. 351 // If inSplitScreen, translate the image half screen to the right.
352 // Thus we have two copies of the image on each half of the screen. 352 // Thus we have two copies of the image on each half of the screen.
353 contentRect.fLeft += inSplitScreen ? (contentRect.fRight - contentRect.f Left) * 0.5f : 0f; 353 contentRect.fLeft +=
354 inSplitScreen ? (contentRect.fRight - contentRect.fLeft) * 0.5f : 0.0f;
354 canvas->clipRect(contentRect); 355 canvas->clipRect(contentRect);
355 canvas->translate(contentRect.fLeft, contentRect.fTop); 356 canvas->translate(contentRect.fLeft, contentRect.fTop);
356 } 357 }
357 358
358 canvas->clear(SK_ColorWHITE); 359 canvas->clear(SK_ColorWHITE);
359 canvas->concat(fDefaultMatrix); 360 canvas->concat(fDefaultMatrix);
360 canvas->concat(computeMatrix()); 361 canvas->concat(computeMatrix());
361 362
362 canvas->getMetaData().setBool(kImageColorXformMetaData, inSplitScreen); 363 canvas->getMetaData().setBool(kImageColorXformMetaData, inSplitScreen);
363 fSlides[fCurrentSlide]->draw(canvas); 364 fSlides[fCurrentSlide]->draw(canvas);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 bool newSplitScreen = stateValue.equals(kON); 559 bool newSplitScreen = stateValue.equals(kON);
559 if (newSplitScreen != fSplitScreen) { 560 if (newSplitScreen != fSplitScreen) {
560 fSplitScreen = newSplitScreen; 561 fSplitScreen = newSplitScreen;
561 fWindow->inval(); 562 fWindow->inval();
562 updateUIState(); 563 updateUIState();
563 } 564 }
564 } else { 565 } else {
565 SkDebugf("Unknown stateName: %s", stateName.c_str()); 566 SkDebugf("Unknown stateName: %s", stateName.c_str());
566 } 567 }
567 } 568 }
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