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 "PictureRenderer.h" | 8 #include "PictureRenderer.h" |
9 #include "picture_utils.h" | 9 #include "picture_utils.h" |
10 #include "SamplePipeControllers.h" | 10 #include "SamplePipeControllers.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 SkASSERT(nullptr == fCanvas.get()); | 69 SkASSERT(nullptr == fCanvas.get()); |
70 if (fPicture || fCanvas.get()) { | 70 if (fPicture || fCanvas.get()) { |
71 return; | 71 return; |
72 } | 72 } |
73 | 73 |
74 SkASSERT(pict != nullptr); | 74 SkASSERT(pict != nullptr); |
75 if (nullptr == pict) { | 75 if (nullptr == pict) { |
76 return; | 76 return; |
77 } | 77 } |
78 | 78 |
79 fPicture.reset(pict)->ref(); | 79 fPicture.reset(SkRef(pict)); |
80 fCanvas.reset(this->setupCanvas()); | 80 fCanvas.reset(this->setupCanvas()); |
81 } | 81 } |
82 | 82 |
83 void PictureRenderer::CopyString(SkString* dest, const SkString* src) { | 83 void PictureRenderer::CopyString(SkString* dest, const SkString* src) { |
84 if (src) { | 84 if (src) { |
85 dest->set(*src); | 85 dest->set(*src); |
86 } else { | 86 } else { |
87 dest->reset(); | 87 dest->reset(); |
88 } | 88 } |
89 } | 89 } |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 const SkString* mismatchPath, const SkString* in
putFilename, | 496 const SkString* mismatchPath, const SkString* in
putFilename, |
497 bool useChecksumBasedFilenames, bool useMultiPic
tureDraw) { | 497 bool useChecksumBasedFilenames, bool useMultiPic
tureDraw) { |
498 SkASSERT(pict); | 498 SkASSERT(pict); |
499 SkASSERT(0 == fTileRects.count()); | 499 SkASSERT(0 == fTileRects.count()); |
500 if (nullptr == pict || fTileRects.count() != 0) { | 500 if (nullptr == pict || fTileRects.count() != 0) { |
501 return; | 501 return; |
502 } | 502 } |
503 | 503 |
504 // Do not call INHERITED::init(), which would create a (potentially large) c
anvas which is not | 504 // Do not call INHERITED::init(), which would create a (potentially large) c
anvas which is not |
505 // used by bench_pictures. | 505 // used by bench_pictures. |
506 fPicture.reset(pict)->ref(); | 506 fPicture.reset(SkRef(pict)); |
507 this->CopyString(&fWritePath, writePath); | 507 this->CopyString(&fWritePath, writePath); |
508 this->CopyString(&fMismatchPath, mismatchPath); | 508 this->CopyString(&fMismatchPath, mismatchPath); |
509 this->CopyString(&fInputFilename, inputFilename); | 509 this->CopyString(&fInputFilename, inputFilename); |
510 fUseChecksumBasedFilenames = useChecksumBasedFilenames; | 510 fUseChecksumBasedFilenames = useChecksumBasedFilenames; |
511 fUseMultiPictureDraw = useMultiPictureDraw; | 511 fUseMultiPictureDraw = useMultiPictureDraw; |
512 this->buildBBoxHierarchy(); | 512 this->buildBBoxHierarchy(); |
513 | 513 |
514 if (fTileWidthPercentage > 0) { | 514 if (fTileWidthPercentage > 0) { |
515 fTileWidth = SkScalarCeilToInt(float(fTileWidthPercentage * fPicture->cu
llRect().width() / 100)); | 515 fTileWidth = SkScalarCeilToInt(float(fTileWidthPercentage * fPicture->cu
llRect().width() / 100)); |
516 } | 516 } |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 case kNone_BBoxHierarchyType: | 825 case kNone_BBoxHierarchyType: |
826 return nullptr; | 826 return nullptr; |
827 case kRTree_BBoxHierarchyType: | 827 case kRTree_BBoxHierarchyType: |
828 return new SkRTreeFactory; | 828 return new SkRTreeFactory; |
829 } | 829 } |
830 SkASSERT(0); // invalid bbhType | 830 SkASSERT(0); // invalid bbhType |
831 return nullptr; | 831 return nullptr; |
832 } | 832 } |
833 | 833 |
834 } // namespace sk_tools | 834 } // namespace sk_tools |
OLD | NEW |