Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: src/core/SkPictureData.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkPictureData.h ('k') | src/core/SkPicturePlayback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #include <new> 7 #include <new>
8 #include "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkDrawPictureCallback.h" 9 #include "SkDrawPictureCallback.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 12 matching lines...) Expand all
23 return obj ? obj->count() : 0; 23 return obj ? obj->count() : 0;
24 } 24 }
25 25
26 SkPictureData::SkPictureData(const SkPictInfo& info) 26 SkPictureData::SkPictureData(const SkPictInfo& info)
27 : fInfo(info) { 27 : fInfo(info) {
28 this->init(); 28 this->init();
29 } 29 }
30 30
31 void SkPictureData::initForPlayback() const { 31 void SkPictureData::initForPlayback() const {
32 // ensure that the paths bounds are pre-computed 32 // ensure that the paths bounds are pre-computed
33 if (NULL != fPathHeap.get()) { 33 if (fPathHeap.get()) {
34 for (int i = 0; i < fPathHeap->count(); i++) { 34 for (int i = 0; i < fPathHeap->count(); i++) {
35 (*fPathHeap.get())[i].updateBoundsCache(); 35 (*fPathHeap.get())[i].updateBoundsCache();
36 } 36 }
37 } 37 }
38 } 38 }
39 39
40 SkPictureData::SkPictureData(const SkPictureRecord& record, 40 SkPictureData::SkPictureData(const SkPictureRecord& record,
41 const SkPictInfo& info, 41 const SkPictInfo& info,
42 bool deepCopyOps) 42 bool deepCopyOps)
43 : fInfo(info) { 43 : fInfo(info) {
44 44
45 this->init(); 45 this->init();
46 46
47 fOpData = record.opData(deepCopyOps); 47 fOpData = record.opData(deepCopyOps);
48 48
49 fBoundingHierarchy = record.fBoundingHierarchy; 49 fBoundingHierarchy = record.fBoundingHierarchy;
50 fStateTree = record.fStateTree; 50 fStateTree = record.fStateTree;
51 51
52 SkSafeRef(fBoundingHierarchy); 52 SkSafeRef(fBoundingHierarchy);
53 SkSafeRef(fStateTree); 53 SkSafeRef(fStateTree);
54 fContentInfo.set(record.fContentInfo); 54 fContentInfo.set(record.fContentInfo);
55 55
56 if (NULL != fBoundingHierarchy) { 56 if (fBoundingHierarchy) {
57 fBoundingHierarchy->flushDeferredInserts(); 57 fBoundingHierarchy->flushDeferredInserts();
58 } 58 }
59 59
60 // copy over the refcnt dictionary to our reader 60 // copy over the refcnt dictionary to our reader
61 record.fFlattenableHeap.setupPlaybacks(); 61 record.fFlattenableHeap.setupPlaybacks();
62 62
63 fBitmaps = record.fBitmapHeap->extractBitmaps(); 63 fBitmaps = record.fBitmapHeap->extractBitmaps();
64 fPaints = record.fPaints.unflattenToArray(); 64 fPaints = record.fPaints.unflattenToArray();
65 65
66 fBitmapHeap.reset(SkSafeRef(record.fBitmapHeap)); 66 fBitmapHeap.reset(SkSafeRef(record.fBitmapHeap));
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 } 662 }
663 } 663 }
664 664
665 bool SkPictureData::suitableForLayerOptimization() const { 665 bool SkPictureData::suitableForLayerOptimization() const {
666 return fContentInfo.numLayers() > 0; 666 return fContentInfo.numLayers() > 0;
667 } 667 }
668 #endif 668 #endif
669 /////////////////////////////////////////////////////////////////////////////// 669 ///////////////////////////////////////////////////////////////////////////////
670 670
671 671
OLDNEW
« no previous file with comments | « src/core/SkPictureData.h ('k') | src/core/SkPicturePlayback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698