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

Unified Diff: src/core/SkPictureRecord.cpp

Issue 435093003: Keep track of the number of skia operations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed the return type of numOperations Created 6 years, 4 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 | « src/core/SkPictureRecord.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.cpp
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index ab4c3fa38eaf353b4ff793f1b94f70b2dbb41ed7..a5f6e3009d2cc89d44d9c8f182074fa21249d5e6 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -971,20 +971,14 @@ void SkPictureRecord::drawPoints(PointMode mode, size_t count, const SkPoint pts
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType);
#endif
+ fContentInfo.onDrawPoints(count, paint);
// op + paint index + mode + count + point data
size_t size = 4 * kUInt32Size + count * sizeof(SkPoint);
size_t initialOffset = this->addDraw(DRAW_POINTS, &size);
SkASSERT(initialOffset+getPaintOffset(DRAW_POINTS, size) == fWriter.bytesWritten());
this->addPaint(paint);
- if (paint.getPathEffect() != NULL) {
- SkPathEffect::DashInfo info;
- SkPathEffect::DashType dashType = paint.getPathEffect()->asADash(&info);
- if (2 == count && SkPaint::kRound_Cap != paint.getStrokeCap() &&
- SkPathEffect::kDash_DashType == dashType && 2 == info.fCount) {
- fContentInfo.incFastPathDashEffects();
- }
- }
+
this->addInt(mode);
this->addInt(SkToInt(count));
fWriter.writeMul4(pts, count * sizeof(SkPoint));
@@ -1061,14 +1055,7 @@ void SkPictureRecord::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
void SkPictureRecord::drawPath(const SkPath& path, const SkPaint& paint) {
- if (paint.isAntiAlias() && !path.isConvex()) {
- fContentInfo.incAAConcavePaths();
-
- if (SkPaint::kStroke_Style == paint.getStyle() &&
- 0 == paint.getStrokeWidth()) {
- fContentInfo.incAAHairlineConcavePaths();
- }
- }
+ fContentInfo.onDrawPath(path, paint);
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType);
@@ -1584,9 +1571,7 @@ const SkFlatData* SkPictureRecord::getFlatPaintData(const SkPaint& paint) {
}
const SkFlatData* SkPictureRecord::addPaintPtr(const SkPaint* paint) {
- if (NULL != paint && NULL != paint->getPathEffect()) {
- fContentInfo.incPaintWithPathEffectUses();
- }
+ fContentInfo.onAddPaintPtr(paint);
const SkFlatData* data = paint ? getFlatPaintData(*paint) : NULL;
this->addFlatPaint(data);
@@ -1684,6 +1669,7 @@ void SkPictureRecord::addRegion(const SkRegion& region) {
}
void SkPictureRecord::addText(const void* text, size_t byteLength) {
+ fContentInfo.onDrawText();
#ifdef SK_DEBUG_SIZE
size_t start = fWriter.bytesWritten();
#endif
« 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