| OLD | NEW |
| 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 10 matching lines...) Expand all Loading... |
| 21 #include "SkReadBuffer.h" | 21 #include "SkReadBuffer.h" |
| 22 #include "SkWriteBuffer.h" | 22 #include "SkWriteBuffer.h" |
| 23 #include "SkGradientShader.h" | 23 #include "SkGradientShader.h" |
| 24 #include "SkImageDecoder.h" | 24 #include "SkImageDecoder.h" |
| 25 #include "SkLayerRasterizer.h" | 25 #include "SkLayerRasterizer.h" |
| 26 #include "SkMath.h" | 26 #include "SkMath.h" |
| 27 #include "SkPath.h" | 27 #include "SkPath.h" |
| 28 #include "SkPictureRecorder.h" | 28 #include "SkPictureRecorder.h" |
| 29 #include "SkRegion.h" | 29 #include "SkRegion.h" |
| 30 #include "SkShader.h" | 30 #include "SkShader.h" |
| 31 #include "SkComposeShader.h" | |
| 32 #include "SkCornerPathEffect.h" | 31 #include "SkCornerPathEffect.h" |
| 33 #include "SkPathMeasure.h" | 32 #include "SkPathMeasure.h" |
| 34 #include "SkPicture.h" | 33 #include "SkPicture.h" |
| 35 #include "SkRandom.h" | 34 #include "SkRandom.h" |
| 36 #include "SkTypeface.h" | 35 #include "SkTypeface.h" |
| 37 #include "SkUtils.h" | 36 #include "SkUtils.h" |
| 38 #include "SkXfermode.h" | 37 #include "SkXfermode.h" |
| 39 | 38 |
| 40 #include <math.h> | 39 #include <math.h> |
| 41 | 40 |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 SkShader* shaderTest() { | 503 SkShader* shaderTest() { |
| 505 SkPoint pts[] = { { 0, 0, }, { SkIntToScalar(100), 0 } }; | 504 SkPoint pts[] = { { 0, 0, }, { SkIntToScalar(100), 0 } }; |
| 506 SkColor colors[] = { SK_ColorRED, SK_ColorBLUE }; | 505 SkColor colors[] = { SK_ColorRED, SK_ColorBLUE }; |
| 507 SkShader* shaderA = SkGradientShader::CreateLinear(pts, colors, nullptr, | 506 SkShader* shaderA = SkGradientShader::CreateLinear(pts, colors, nullptr, |
| 508 2, SkShader::kClamp_TileMode); | 507 2, SkShader::kClamp_TileMode); |
| 509 pts[1].set(0, SkIntToScalar(100)); | 508 pts[1].set(0, SkIntToScalar(100)); |
| 510 SkColor colors2[] = {SK_ColorBLACK, SkColorSetARGB(0x80, 0, 0, 0)}; | 509 SkColor colors2[] = {SK_ColorBLACK, SkColorSetARGB(0x80, 0, 0, 0)}; |
| 511 SkShader* shaderB = SkGradientShader::CreateLinear(pts, colors2, nullptr
, | 510 SkShader* shaderB = SkGradientShader::CreateLinear(pts, colors2, nullptr
, |
| 512 2, SkShader::kClamp_TileMode); | 511 2, SkShader::kClamp_TileMode); |
| 513 SkXfermode* mode = SkXfermode::Create(SkXfermode::kDstIn_Mode); | 512 SkXfermode* mode = SkXfermode::Create(SkXfermode::kDstIn_Mode); |
| 514 SkShader* result = new SkComposeShader(shaderA, shaderB, mode); | 513 SkShader* result = SkShader::CreateComposeShader(shaderA, shaderB, mode)
; |
| 515 shaderA->unref(); | 514 shaderA->unref(); |
| 516 shaderB->unref(); | 515 shaderB->unref(); |
| 517 mode->unref(); | 516 mode->unref(); |
| 518 return result; | 517 return result; |
| 519 } | 518 } |
| 520 | 519 |
| 521 virtual void startTest() { | 520 virtual void startTest() { |
| 522 SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/bugcirc.gif", &fBug
); | 521 SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/bugcirc.gif", &fBug
); |
| 523 SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/tbcirc.gif", &fTb); | 522 SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/tbcirc.gif", &fTb); |
| 524 SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/05psp04.gif", &fTx)
; | 523 SkImageDecoder::DecodeFile("/Users/caryclark/Desktop/05psp04.gif", &fTx)
; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 private: | 570 private: |
| 572 SkPoint fClickPt; | 571 SkPoint fClickPt; |
| 573 SkBitmap fBug, fTb, fTx; | 572 SkBitmap fBug, fTb, fTx; |
| 574 typedef SampleView INHERITED; | 573 typedef SampleView INHERITED; |
| 575 }; | 574 }; |
| 576 | 575 |
| 577 ////////////////////////////////////////////////////////////////////////////// | 576 ////////////////////////////////////////////////////////////////////////////// |
| 578 | 577 |
| 579 static SkView* MyFactory() { return new DemoView; } | 578 static SkView* MyFactory() { return new DemoView; } |
| 580 static SkViewRegister reg(MyFactory); | 579 static SkViewRegister reg(MyFactory); |
| OLD | NEW |