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

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

Issue 723593002: Start stripping out complicated parts of SkPicture{Record,Data}. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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
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 30 matching lines...) Expand all
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 fContentInfo.set(record.fContentInfo); 49 fContentInfo.set(record.fContentInfo);
50 50
51 // copy over the refcnt dictionary to our reader
52 record.fFlattenableHeap.setupPlaybacks();
53
54 fBitmaps = record.fBitmapHeap->extractBitmaps(); 51 fBitmaps = record.fBitmapHeap->extractBitmaps();
55 fPaints = record.fPaints.unflattenToArray(); 52 fPaints = SkTRefArray<SkPaint>::Create(record.fPaints.begin(), record.fPaint s.count());
56 53
57 fBitmapHeap.reset(SkSafeRef(record.fBitmapHeap)); 54 fBitmapHeap.reset(SkSafeRef(record.fBitmapHeap));
58 fPathHeap.reset(SkSafeRef(record.pathHeap())); 55 fPathHeap.reset(SkSafeRef(record.pathHeap()));
59 56
60 this->initForPlayback(); 57 this->initForPlayback();
61 58
62 const SkTDArray<const SkPicture* >& pictures = record.getPictureRefs(); 59 const SkTDArray<const SkPicture* >& pictures = record.getPictureRefs();
63 fPictureCount = pictures.count(); 60 fPictureCount = pictures.count();
64 if (fPictureCount > 0) { 61 if (fPictureCount > 0) {
65 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); 62 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount);
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 } 579 }
583 } 580 }
584 581
585 bool SkPictureData::suitableForLayerOptimization() const { 582 bool SkPictureData::suitableForLayerOptimization() const {
586 return fContentInfo.numLayers() > 0; 583 return fContentInfo.numLayers() > 0;
587 } 584 }
588 #endif 585 #endif
589 /////////////////////////////////////////////////////////////////////////////// 586 ///////////////////////////////////////////////////////////////////////////////
590 587
591 588
OLDNEW
« no previous file with comments | « gyp/tests.gypi ('k') | src/core/SkPictureFlat.h » ('j') | src/core/SkPictureRecord.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698