| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 paint.setColor(alpha.rgb()); | 201 paint.setColor(alpha.rgb()); |
| 202 paint.setXfermodeMode(SkXfermode::kSrcOut_Mode); | 202 paint.setXfermodeMode(SkXfermode::kSrcOut_Mode); |
| 203 context->drawPath(path.skPath(), paint); | 203 context->drawPath(path.skPath(), paint); |
| 204 | 204 |
| 205 EXPECT_OPAQUE_PIXELS_IN_RECT(bitmap, IntRect(20, 10, 30, 40)); | 205 EXPECT_OPAQUE_PIXELS_IN_RECT(bitmap, IntRect(20, 10, 30, 40)); |
| 206 } | 206 } |
| 207 | 207 |
| 208 #define DISPATCH1(c1, c2, op, param1) do { c1->op(param1); c2->op(param1); } whi
le (0); | 208 #define DISPATCH1(c1, c2, op, param1) do { c1->op(param1); c2->op(param1); } whi
le (0); |
| 209 #define DISPATCH2(c1, c2, op, param1, param2) do { c1->op(param1, param2); c2->o
p(param1, param2); } while (0); | 209 #define DISPATCH2(c1, c2, op, param1, param2) do { c1->op(param1, param2); c2->o
p(param1, param2); } while (0); |
| 210 | 210 |
| 211 TEST(GraphicsContextTest, RecordingTotalMatrix) | 211 TEST(GraphicsContextTest, DISABLED_RecordingTotalMatrix) |
| 212 { | 212 { |
| 213 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 213 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 214 // GraphicsContext::getCTM() won't do the right thing in Slimming Paint,
so just skip this test. | 214 // GraphicsContext::getCTM() won't do the right thing in Slimming Paint,
so just skip this test. |
| 215 return; | 215 return; |
| 216 } | 216 } |
| 217 | 217 |
| 218 SkBitmap bitmap; | 218 SkBitmap bitmap; |
| 219 bitmap.allocN32Pixels(400, 400); | 219 bitmap.allocN32Pixels(400, 400); |
| 220 bitmap.eraseColor(0); | 220 bitmap.eraseColor(0); |
| 221 SkCanvas canvas(bitmap); | 221 SkCanvas canvas(bitmap); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 240 | 240 |
| 241 controlContext->restore(); | 241 controlContext->restore(); |
| 242 context->endRecording(); | 242 context->endRecording(); |
| 243 EXPECT_EQ(context->getCTM(), controlContext->getCTM()); | 243 EXPECT_EQ(context->getCTM(), controlContext->getCTM()); |
| 244 | 244 |
| 245 controlContext->restore(); | 245 controlContext->restore(); |
| 246 context->endRecording(); | 246 context->endRecording(); |
| 247 EXPECT_EQ(context->getCTM(), controlContext->getCTM()); | 247 EXPECT_EQ(context->getCTM(), controlContext->getCTM()); |
| 248 } | 248 } |
| 249 | 249 |
| 250 TEST(GraphicsContextTest, RecordingCanvas) | 250 TEST(GraphicsContextTest, DISABLED_RecordingCanvas) |
| 251 { | 251 { |
| 252 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 252 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 253 // This test doesn't make any sense in slimming paint as you can't begin
recording within an existing recording, | 253 // This test doesn't make any sense in slimming paint as you can't begin
recording within an existing recording, |
| 254 // so just bail out. | 254 // so just bail out. |
| 255 return; | 255 return; |
| 256 } | 256 } |
| 257 | 257 |
| 258 SkBitmap bitmap; | 258 SkBitmap bitmap; |
| 259 bitmap.allocN32Pixels(1, 1); | 259 bitmap.allocN32Pixels(1, 1); |
| 260 bitmap.eraseColor(0); | 260 bitmap.eraseColor(0); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 277 EXPECT_TRUE(canvas1->unique()); | 277 EXPECT_TRUE(canvas1->unique()); |
| 278 | 278 |
| 279 // endRecording finally makes the picture accessible | 279 // endRecording finally makes the picture accessible |
| 280 RefPtr<const SkPicture> picture = context->endRecording(); | 280 RefPtr<const SkPicture> picture = context->endRecording(); |
| 281 EXPECT_TRUE(picture); | 281 EXPECT_TRUE(picture); |
| 282 | 282 |
| 283 context->endRecording(); | 283 context->endRecording(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace | 286 } // namespace |
| OLD | NEW |