OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |