| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "Test.h" | 8 #include "Test.h" |
| 9 | 9 |
| 10 #include "../include/core/SkCanvas.h" | 10 #include "../include/core/SkCanvas.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 whitePaint.setColor(0xffffffff); | 43 whitePaint.setColor(0xffffffff); |
| 44 SkPaint layerPaint; | 44 SkPaint layerPaint; |
| 45 layerPaint.setColor(0xff000000); | 45 layerPaint.setColor(0xff000000); |
| 46 layerPaint.setXfermodeMode(mode); | 46 layerPaint.setXfermodeMode(mode); |
| 47 SkRect canvasRect(SkRect::MakeWH(SkIntToScalar(fImageInfo.width()), | 47 SkRect canvasRect(SkRect::MakeWH(SkIntToScalar(fImageInfo.width()), |
| 48 SkIntToScalar(fImageInfo.height()))); | 48 SkIntToScalar(fImageInfo.height()))); |
| 49 | 49 |
| 50 canvas->clipRect(clipRect); | 50 canvas->clipRect(clipRect); |
| 51 canvas->clear(0xff000000); | 51 canvas->clear(0xff000000); |
| 52 | 52 |
| 53 canvas->saveLayer(NULL, &blackPaint); | 53 canvas->saveLayer(nullptr, &blackPaint); |
| 54 canvas->drawRect(canvasRect, greenPaint); | 54 canvas->drawRect(canvasRect, greenPaint); |
| 55 canvas->saveLayer(NULL, &layerPaint); | 55 canvas->saveLayer(nullptr, &layerPaint); |
| 56 canvas->drawBitmapRect(fCircleBM, SkRect::MakeXYWH(20,20,60,60),
&blackPaint); | 56 canvas->drawBitmapRect(fCircleBM, SkRect::MakeXYWH(20,20,60,60),
&blackPaint); |
| 57 canvas->restore(); | 57 canvas->restore(); |
| 58 canvas->restore(); | 58 canvas->restore(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 const SkImageInfo fImageInfo; | 62 const SkImageInfo fImageInfo; |
| 63 SkBitmap fCircleBM; | 63 SkBitmap fCircleBM; |
| 64 }; | 64 }; |
| 65 | 65 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 errors.appendf("For SkXfermode %d %s: SkPictureRecorder bitmap is
wrong\n", | 164 errors.appendf("For SkXfermode %d %s: SkPictureRecorder bitmap is
wrong\n", |
| 165 iMode, SkXfermode::ModeName(mode)); | 165 iMode, SkXfermode::ModeName(mode)); |
| 166 } | 166 } |
| 167 #endif | 167 #endif |
| 168 } | 168 } |
| 169 | 169 |
| 170 #if !FINEGRAIN | 170 #if !FINEGRAIN |
| 171 REPORTER_ASSERT_MESSAGE(reporter, 0 == numErrors, errors.c_str()); | 171 REPORTER_ASSERT_MESSAGE(reporter, 0 == numErrors, errors.c_str()); |
| 172 #endif | 172 #endif |
| 173 } | 173 } |
| OLD | NEW |