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

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

Issue 35543002: Revert "If the path is a rect, call drawRect to raster the geometry in SkCanvas::drawPath to get be… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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') | src/pipe/SkGPipeWrite.cpp » ('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 #include "SkPictureRecord.h" 8 #include "SkPictureRecord.h"
9 #include "SkTSearch.h" 9 #include "SkTSearch.h"
10 #include "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 void SkPictureRecord::drawOval(const SkRect& oval, const SkPaint& paint) { 861 void SkPictureRecord::drawOval(const SkRect& oval, const SkPaint& paint) {
862 // op + paint index + rect 862 // op + paint index + rect
863 uint32_t size = 2 * kUInt32Size + sizeof(oval); 863 uint32_t size = 2 * kUInt32Size + sizeof(oval);
864 size_t initialOffset = this->addDraw(DRAW_OVAL, &size); 864 size_t initialOffset = this->addDraw(DRAW_OVAL, &size);
865 SkASSERT(initialOffset+getPaintOffset(DRAW_OVAL, size) == fWriter.size()); 865 SkASSERT(initialOffset+getPaintOffset(DRAW_OVAL, size) == fWriter.size());
866 addPaint(paint); 866 addPaint(paint);
867 addRect(oval); 867 addRect(oval);
868 this->validate(initialOffset, size); 868 this->validate(initialOffset, size);
869 } 869 }
870 870
871 void SkPictureRecord::onDrawRect(const SkRect& rect, const SkPaint& paint) { 871 void SkPictureRecord::drawRect(const SkRect& rect, const SkPaint& paint) {
872 // op + paint index + rect 872 // op + paint index + rect
873 uint32_t size = 2 * kUInt32Size + sizeof(rect); 873 uint32_t size = 2 * kUInt32Size + sizeof(rect);
874 size_t initialOffset = this->addDraw(DRAW_RECT, &size); 874 size_t initialOffset = this->addDraw(DRAW_RECT, &size);
875 SkASSERT(initialOffset+getPaintOffset(DRAW_RECT, size) == fWriter.size()); 875 SkASSERT(initialOffset+getPaintOffset(DRAW_RECT, size) == fWriter.size());
876 addPaint(paint); 876 addPaint(paint);
877 addRect(rect); 877 addRect(rect);
878 this->validate(initialOffset, size); 878 this->validate(initialOffset, size);
879 } 879 }
880 880
881 void SkPictureRecord::drawRRect(const SkRRect& rrect, const SkPaint& paint) { 881 void SkPictureRecord::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
882 if (rrect.isRect()) { 882 if (rrect.isRect()) {
883 this->SkPictureRecord::drawRect(rrect.getBounds(), paint); 883 this->SkPictureRecord::drawRect(rrect.getBounds(), paint);
884 } else if (rrect.isOval()) { 884 } else if (rrect.isOval()) {
885 this->SkPictureRecord::drawOval(rrect.getBounds(), paint); 885 this->SkPictureRecord::drawOval(rrect.getBounds(), paint);
886 } else { 886 } else {
887 // op + paint index + rrect 887 // op + paint index + rrect
888 uint32_t initialOffset, size; 888 uint32_t initialOffset, size;
889 size = 2 * kUInt32Size + SkRRect::kSizeInMemory; 889 size = 2 * kUInt32Size + SkRRect::kSizeInMemory;
890 initialOffset = this->addDraw(DRAW_RRECT, &size); 890 initialOffset = this->addDraw(DRAW_RRECT, &size);
891 SkASSERT(initialOffset+getPaintOffset(DRAW_RRECT, size) == fWriter.size( )); 891 SkASSERT(initialOffset+getPaintOffset(DRAW_RRECT, size) == fWriter.size( ));
892 addPaint(paint); 892 addPaint(paint);
893 addRRect(rrect); 893 addRRect(rrect);
894 this->validate(initialOffset, size); 894 this->validate(initialOffset, size);
895 } 895 }
896 } 896 }
897 897
898 void SkPictureRecord::onDrawPath(const SkPath& path, const SkPaint& paint) { 898 void SkPictureRecord::drawPath(const SkPath& path, const SkPaint& paint) {
899 // op + paint index + path index 899 // op + paint index + path index
900 uint32_t size = 3 * kUInt32Size; 900 uint32_t size = 3 * kUInt32Size;
901 size_t initialOffset = this->addDraw(DRAW_PATH, &size); 901 size_t initialOffset = this->addDraw(DRAW_PATH, &size);
902 SkASSERT(initialOffset+getPaintOffset(DRAW_PATH, size) == fWriter.size()); 902 SkASSERT(initialOffset+getPaintOffset(DRAW_PATH, size) == fWriter.size());
903 addPaint(paint); 903 addPaint(paint);
904 addPath(path); 904 addPath(path);
905 this->validate(initialOffset, size); 905 this->validate(initialOffset, size);
906 } 906 }
907 907
908 void SkPictureRecord::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, 908 void SkPictureRecord::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 void SkPictureRecord::validateRegions() const { 1501 void SkPictureRecord::validateRegions() const {
1502 int count = fRegions.count(); 1502 int count = fRegions.count();
1503 SkASSERT((unsigned) count < 0x1000); 1503 SkASSERT((unsigned) count < 0x1000);
1504 for (int index = 0; index < count; index++) { 1504 for (int index = 0; index < count; index++) {
1505 const SkFlatData* region = fRegions[index]; 1505 const SkFlatData* region = fRegions[index];
1506 SkASSERT(region); 1506 SkASSERT(region);
1507 // region->validate(); 1507 // region->validate();
1508 } 1508 }
1509 } 1509 }
1510 #endif 1510 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698