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

Unified Diff: src/core/SkRecorder.cpp

Issue 449933002: change drawPicture in SkRecord to just ref the picture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/core/SkRecorder.cpp
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 255eb393b3ccd094e909ad3502f287699141880b..19d60d5bf840d54929fe47ab425a40c35baec052 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -57,12 +57,12 @@ T* SkRecorder::copy(const T* src) {
// This copy() is for arrays.
// It will work with POD or non-POD, though currently we only use it for POD.
template <typename T>
-T* SkRecorder::copy(const T src[], unsigned count) {
+T* SkRecorder::copy(const T src[], size_t count) {
if (NULL == src) {
return NULL;
}
T* dst = fRecord->alloc<T>(count);
- for (unsigned i = 0; i < count; i++) {
+ for (size_t i = 0; i < count; i++) {
SkNEW_PLACEMENT_ARGS(dst + i, T, (src[i]));
}
return dst;
@@ -72,7 +72,7 @@ T* SkRecorder::copy(const T src[], unsigned count) {
// This measured around 2x faster for copying code points,
// but I found no corresponding speedup for other arrays.
template <>
-char* SkRecorder::copy(const char src[], unsigned count) {
+char* SkRecorder::copy(const char src[], size_t count) {
if (NULL == src) {
return NULL;
}
@@ -187,7 +187,7 @@ void SkRecorder::onDrawTextOnPath(const void* text, size_t byteLength, const SkP
}
void SkRecorder::onDrawPicture(const SkPicture* picture) {
- picture->draw(this);
+ APPEND(DrawPicture, picture);
}
void SkRecorder::drawVertices(VertexMode vmode,
« no previous file with comments | « src/core/SkRecorder.h ('k') | src/core/SkRecords.h » ('j') | src/core/SkRecords.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698