| 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 "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
| 9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 c->saveLayer(NULL, &layerPaint); // layer #6 | 356 c->saveLayer(NULL, &layerPaint); // layer #6 |
| 357 c->drawPicture(child, &trans, &picturePaint); // layer #7 inside
picture | 357 c->drawPicture(child, &trans, &picturePaint); // layer #7 inside
picture |
| 358 c->restore(); | 358 c->restore(); |
| 359 } | 359 } |
| 360 | 360 |
| 361 pict.reset(recorder.endRecording()); | 361 pict.reset(recorder.endRecording()); |
| 362 } | 362 } |
| 363 | 363 |
| 364 // Now test out the SaveLayer extraction | 364 // Now test out the SaveLayer extraction |
| 365 if (!SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds()) { | 365 if (!SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds()) { |
| 366 SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey(); | 366 const SkBigPicture* bp = pict->asSkBigPicture(); |
| 367 REPORTER_ASSERT(reporter, bp); |
| 367 | 368 |
| 368 const SkPicture::AccelData* data = pict->EXPERIMENTAL_getAccelData(key); | 369 const SkBigPicture::AccelData* data = bp->accelData(); |
| 369 REPORTER_ASSERT(reporter, data); | 370 REPORTER_ASSERT(reporter, data); |
| 370 | 371 |
| 371 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data); | 372 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data); |
| 372 REPORTER_ASSERT(reporter, 8 == gpuData->numBlocks()); | 373 REPORTER_ASSERT(reporter, 8 == gpuData->numBlocks()); |
| 373 | 374 |
| 374 const SkLayerInfo::BlockInfo& info0 = gpuData->block(0); | 375 const SkLayerInfo::BlockInfo& info0 = gpuData->block(0); |
| 375 // The parent/child layers appear in reverse order | 376 // The parent/child layers appear in reverse order |
| 376 const SkLayerInfo::BlockInfo& info1 = gpuData->block(2); | 377 const SkLayerInfo::BlockInfo& info1 = gpuData->block(2); |
| 377 const SkLayerInfo::BlockInfo& info2 = gpuData->block(1); | 378 const SkLayerInfo::BlockInfo& info2 = gpuData->block(1); |
| 378 | 379 |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 DEF_TEST(Picture_getRecordingCanvas, r) { | 1317 DEF_TEST(Picture_getRecordingCanvas, r) { |
| 1317 SkPictureRecorder rec; | 1318 SkPictureRecorder rec; |
| 1318 REPORTER_ASSERT(r, !rec.getRecordingCanvas()); | 1319 REPORTER_ASSERT(r, !rec.getRecordingCanvas()); |
| 1319 for (int i = 0; i < 3; i++) { | 1320 for (int i = 0; i < 3; i++) { |
| 1320 rec.beginRecording(100, 100); | 1321 rec.beginRecording(100, 100); |
| 1321 REPORTER_ASSERT(r, rec.getRecordingCanvas()); | 1322 REPORTER_ASSERT(r, rec.getRecordingCanvas()); |
| 1322 rec.endRecording()->unref(); | 1323 rec.endRecording()->unref(); |
| 1323 REPORTER_ASSERT(r, !rec.getRecordingCanvas()); | 1324 REPORTER_ASSERT(r, !rec.getRecordingCanvas()); |
| 1324 } | 1325 } |
| 1325 } | 1326 } |
| OLD | NEW |