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

Side by Side Diff: samplecode/SampleAll.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkSize.h ('k') | samplecode/SampleApp.cpp » ('j') | 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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 paint.setMaskFilter(NULL); 444 paint.setMaskFilter(NULL);
445 canvas->drawPath(path, paint); 445 canvas->drawPath(path, paint);
446 446
447 paint.setShader(NULL); 447 paint.setShader(NULL);
448 // bitmap, sprite 448 // bitmap, sprite
449 canvas->translate(SkIntToScalar(50), 0); 449 canvas->translate(SkIntToScalar(50), 0);
450 paint.setStyle(SkPaint::kFill_Style); 450 paint.setStyle(SkPaint::kFill_Style);
451 canvas->drawBitmap(fBug, left, top, &paint); 451 canvas->drawBitmap(fBug, left, top, &paint);
452 canvas->translate(SkIntToScalar(30), 0); 452 canvas->translate(SkIntToScalar(30), 0);
453 canvas->drawSprite(fTb, 453 canvas->drawSprite(fTb,
454 SkScalarRound(canvas->getTotalMatrix().getTranslateX()), 454 SkScalarRoundToInt(canvas->getTotalMatrix().getTranslateX()),
455 spriteOffset + 10, &paint); 455 spriteOffset + 10, &paint);
456 456
457 canvas->translate(-SkIntToScalar(30), SkIntToScalar(30)); 457 canvas->translate(-SkIntToScalar(30), SkIntToScalar(30));
458 paint.setShader(shaderTest())->unref(); // test compose shader 458 paint.setShader(shaderTest())->unref(); // test compose shader
459 canvas->drawRect(rect2, paint); 459 canvas->drawRect(rect2, paint);
460 paint.setShader(NULL); 460 paint.setShader(NULL);
461 461
462 canvas->restore(); 462 canvas->restore();
463 // text 463 // text
464 canvas->translate(0, SkIntToScalar(60)); 464 canvas->translate(0, SkIntToScalar(60));
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 private: 641 private:
642 SkPoint fClickPt; 642 SkPoint fClickPt;
643 SkBitmap fBug, fTb, fTx; 643 SkBitmap fBug, fTb, fTx;
644 typedef SampleView INHERITED; 644 typedef SampleView INHERITED;
645 }; 645 };
646 646
647 ////////////////////////////////////////////////////////////////////////////// 647 //////////////////////////////////////////////////////////////////////////////
648 648
649 static SkView* MyFactory() { return new DemoView; } 649 static SkView* MyFactory() { return new DemoView; }
650 static SkViewRegister reg(MyFactory); 650 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/core/SkSize.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698