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

Unified Diff: src/core/SkPictureRecord.cpp

Issue 15057005: Remove duplicated code in SkPictureRecord::drawRRect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.cpp
===================================================================
--- src/core/SkPictureRecord.cpp (revision 9089)
+++ src/core/SkPictureRecord.cpp (working copy)
@@ -931,19 +931,9 @@
void SkPictureRecord::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
robertphillips 2013/05/10 14:08:40 Could also move these into the final else block
uint32_t initialOffset, size;
if (rrect.isRect()) {
- // op + paint index + rect
- size = 2 * kUInt32Size + sizeof(SkRect);
- initialOffset = this->addDraw(DRAW_RECT, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_RECT, size) == fWriter.size());
- addPaint(paint);
- addRect(rrect.getBounds());
+ this->SkPictureRecord::drawRect(rrect.getBounds(), paint);
} else if (rrect.isOval()) {
- // op + paint index + rect
- size = 2 * kUInt32Size + sizeof(SkRect);
- initialOffset = this->addDraw(DRAW_OVAL, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_OVAL, size) == fWriter.size());
- addPaint(paint);
- addRect(rrect.getBounds());
+ this->SkPictureRecord::drawOval(rrect.getBounds(), paint);
} else {
// op + paint index + rrect
size = 2 * kUInt32Size + SkRRect::kSizeInMemory;
@@ -951,8 +941,8 @@
SkASSERT(initialOffset+getPaintOffset(DRAW_RRECT, size) == fWriter.size());
addPaint(paint);
addRRect(rrect);
+ validate(initialOffset, size);
}
- validate(initialOffset, size);
}
void SkPictureRecord::drawPath(const SkPath& path, const SkPaint& paint) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698