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

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

Issue 168983003: change PictureRecord (and its private subclasses) to take size instead of device (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | no next file » | 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 7
8 #include "SkPictureRecord.h" 8 #include "SkPictureRecord.h"
9 #include "SkTSearch.h" 9 #include "SkTSearch.h"
10 #include "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 10 matching lines...) Expand all
21 kNoInitialSave = -1, 21 kNoInitialSave = -1,
22 }; 22 };
23 23
24 // A lot of basic types get stored as a uint32_t: bools, ints, paint indices, et c. 24 // A lot of basic types get stored as a uint32_t: bools, ints, paint indices, et c.
25 static int const kUInt32Size = 4; 25 static int const kUInt32Size = 4;
26 26
27 static const uint32_t kSaveSize = 2 * kUInt32Size; 27 static const uint32_t kSaveSize = 2 * kUInt32Size;
28 static const uint32_t kSaveLayerNoBoundsSize = 4 * kUInt32Size; 28 static const uint32_t kSaveLayerNoBoundsSize = 4 * kUInt32Size;
29 static const uint32_t kSaveLayerWithBoundsSize = 4 * kUInt32Size + sizeof(SkRect ); 29 static const uint32_t kSaveLayerWithBoundsSize = 4 * kUInt32Size + sizeof(SkRect );
30 30
31 SkPictureRecord::SkPictureRecord(uint32_t flags, SkBaseDevice* device) 31 SkPictureRecord::SkPictureRecord(const SkISize& dimensions, uint32_t flags)
32 : INHERITED(device) 32 : INHERITED(dimensions.width(), dimensions.height())
33 , fBoundingHierarchy(NULL) 33 , fBoundingHierarchy(NULL)
34 , fStateTree(NULL) 34 , fStateTree(NULL)
35 , fFlattenableHeap(HEAP_BLOCK_SIZE) 35 , fFlattenableHeap(HEAP_BLOCK_SIZE)
36 , fPaints(&fFlattenableHeap) 36 , fPaints(&fFlattenableHeap)
37 , fRecordFlags(flags) { 37 , fRecordFlags(flags) {
38 #ifdef SK_DEBUG_SIZE 38 #ifdef SK_DEBUG_SIZE
39 fPointBytes = fRectBytes = fTextBytes = 0; 39 fPointBytes = fRectBytes = fTextBytes = 0;
40 fPointWrites = fRectWrites = fTextWrites = 0; 40 fPointWrites = fRectWrites = fTextWrites = 0;
41 #endif 41 #endif
42 42
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 void SkPictureRecord::validateRegions() const { 1778 void SkPictureRecord::validateRegions() const {
1779 int count = fRegions.count(); 1779 int count = fRegions.count();
1780 SkASSERT((unsigned) count < 0x1000); 1780 SkASSERT((unsigned) count < 0x1000);
1781 for (int index = 0; index < count; index++) { 1781 for (int index = 0; index < count; index++) {
1782 const SkFlatData* region = fRegions[index]; 1782 const SkFlatData* region = fRegions[index];
1783 SkASSERT(region); 1783 SkASSERT(region);
1784 // region->validate(); 1784 // region->validate();
1785 } 1785 }
1786 } 1786 }
1787 #endif 1787 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698