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

Side by Side Diff: src/core/SkPictureFlat.h

Issue 12315131: Make SkTDArray accessors const-friendly (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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/SkPathHeap.cpp ('k') | src/gpu/GrTHashCache.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef SkPictureFlat_DEFINED 8 #ifndef SkPictureFlat_DEFINED
9 #define SkPictureFlat_DEFINED 9 #define SkPictureFlat_DEFINED
10 10
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 return flat; 523 return flat;
524 } 524 }
525 525
526 protected: 526 protected:
527 void (*fFlattenProc)(SkOrderedWriteBuffer&, const void*); 527 void (*fFlattenProc)(SkOrderedWriteBuffer&, const void*);
528 void (*fUnflattenProc)(SkOrderedReadBuffer&, void*); 528 void (*fUnflattenProc)(SkOrderedReadBuffer&, void*);
529 529
530 private: 530 private:
531 void unflattenIntoArray(T* array) const { 531 void unflattenIntoArray(T* array) const {
532 const int count = fData.count(); 532 const int count = fData.count();
533 const SkFlatData** iter = fData.begin(); 533 const SkFlatData* const* iter = fData.begin();
534 for (int i = 0; i < count; ++i) { 534 for (int i = 0; i < count; ++i) {
535 const SkFlatData* element = iter[i]; 535 const SkFlatData* element = iter[i];
536 int index = element->index() - 1; 536 int index = element->index() - 1;
537 SkASSERT((unsigned)index < (unsigned)count); 537 SkASSERT((unsigned)index < (unsigned)count);
538 element->unflatten(&array[index], fUnflattenProc, 538 element->unflatten(&array[index], fUnflattenProc,
539 fController->getBitmapHeap(), 539 fController->getBitmapHeap(),
540 fController->getTypefacePlayback()); 540 fController->getTypefacePlayback());
541 } 541 }
542 } 542 }
543 543
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 static void flattenRegion(SkOrderedWriteBuffer& buffer, const void* obj) { 666 static void flattenRegion(SkOrderedWriteBuffer& buffer, const void* obj) {
667 buffer.getWriter32()->writeRegion(*(SkRegion*)obj); 667 buffer.getWriter32()->writeRegion(*(SkRegion*)obj);
668 } 668 }
669 669
670 static void unflattenRegion(SkOrderedReadBuffer& buffer, void* obj) { 670 static void unflattenRegion(SkOrderedReadBuffer& buffer, void* obj) {
671 buffer.getReader32()->readRegion((SkRegion*)obj); 671 buffer.getReader32()->readRegion((SkRegion*)obj);
672 } 672 }
673 }; 673 };
674 674
675 #endif 675 #endif
OLDNEW
« no previous file with comments | « src/core/SkPathHeap.cpp ('k') | src/gpu/GrTHashCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698