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: tests/DeferredCanvasTest.cpp

Issue 296823008: Revert of Remove unused (by clients) SkUnitMapper (https://codereview.chromium.org/283273002/) (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/utils/SkUnitMappers.cpp ('k') | 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 2012 Google Inc. 2 * Copyright 2012 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 "../src/image/SkImagePriv.h" 8 #include "../src/image/SkImagePriv.h"
9 #include "../src/image/SkSurface_Base.h" 9 #include "../src/image/SkSurface_Base.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 SkPaint paint; 352 SkPaint paint;
353 paint.setStyle(SkPaint::kFill_Style); 353 paint.setStyle(SkPaint::kFill_Style);
354 // Defining a cone that partially overlaps the canvas 354 // Defining a cone that partially overlaps the canvas
355 const SkPoint pt1 = SkPoint::Make(SkIntToScalar(0), SkIntToScalar(0)); 355 const SkPoint pt1 = SkPoint::Make(SkIntToScalar(0), SkIntToScalar(0));
356 const SkScalar r1 = SkIntToScalar(1); 356 const SkScalar r1 = SkIntToScalar(1);
357 const SkPoint pt2 = SkPoint::Make(SkIntToScalar(10), SkIntToScalar(0)); 357 const SkPoint pt2 = SkPoint::Make(SkIntToScalar(10), SkIntToScalar(0));
358 const SkScalar r2 = SkIntToScalar(5); 358 const SkScalar r2 = SkIntToScalar(5);
359 const SkColor colors[2] = {SK_ColorWHITE, SK_ColorWHITE}; 359 const SkColor colors[2] = {SK_ColorWHITE, SK_ColorWHITE};
360 const SkScalar pos[2] = {0, SK_Scalar1}; 360 const SkScalar pos[2] = {0, SK_Scalar1};
361 SkShader* shader = SkGradientShader::CreateTwoPointConical( 361 SkShader* shader = SkGradientShader::CreateTwoPointConical(
362 pt1, r1, pt2, r2, colors, pos, 2, SkShader::kClamp_TileMode); 362 pt1, r1, pt2, r2, colors, pos, 2, SkShader::kClamp_TileMode, NULL);
363 paint.setShader(shader)->unref(); 363 paint.setShader(shader)->unref();
364 canvas->drawRect(fullRect, paint); 364 canvas->drawRect(fullRect, paint);
365 REPORTER_ASSERT(reporter, !canvas->isFreshFrame()); 365 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
366 } 366 }
367 { 367 {
368 SkPaint paint; 368 SkPaint paint;
369 paint.setStyle(SkPaint::kFill_Style); 369 paint.setStyle(SkPaint::kFill_Style);
370 SkBitmap bmp; 370 SkBitmap bmp;
371 create(&bmp, 0xFFFFFFFF); 371 create(&bmp, 0xFFFFFFFF);
372 bmp.setAlphaType(kPremul_SkAlphaType); 372 bmp.setAlphaType(kPremul_SkAlphaType);
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 TestDeferredCanvasSurface(reporter, NULL); 831 TestDeferredCanvasSurface(reporter, NULL);
832 TestDeferredCanvasSetSurface(reporter, NULL); 832 TestDeferredCanvasSetSurface(reporter, NULL);
833 } 833 }
834 834
835 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { 835 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
836 if (factory != NULL) { 836 if (factory != NULL) {
837 TestDeferredCanvasSurface(reporter, factory); 837 TestDeferredCanvasSurface(reporter, factory);
838 TestDeferredCanvasSetSurface(reporter, factory); 838 TestDeferredCanvasSetSurface(reporter, factory);
839 } 839 }
840 } 840 }
OLDNEW
« no previous file with comments | « src/utils/SkUnitMappers.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698