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

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

Issue 1112523006: Sketch splitting SkPicture into an interface and SkBigPicture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nullptr Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBigPicture.h"
8 #include "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
9 #include "SkPicture.h" 10 #include "SkPicture.h"
10 #include "SkPictureUtils.h" 11 #include "SkPictureUtils.h"
11 #include "SkRecorder.h" 12 #include "SkRecorder.h"
12 13
13 SkDrawableList::~SkDrawableList() { 14 SkDrawableList::~SkDrawableList() {
14 fArray.unrefAll(); 15 fArray.unrefAll();
15 } 16 }
16 17
17 SkPicture::SnapshotArray* SkDrawableList::newDrawableSnapshot() { 18 SkBigPicture::SnapshotArray* SkDrawableList::newDrawableSnapshot() {
18 const int count = fArray.count(); 19 const int count = fArray.count();
19 if (0 == count) { 20 if (0 == count) {
20 return NULL; 21 return NULL;
21 } 22 }
22 SkAutoTMalloc<const SkPicture*> pics(count); 23 SkAutoTMalloc<const SkPicture*> pics(count);
23 for (int i = 0; i < count; ++i) { 24 for (int i = 0; i < count; ++i) {
24 pics[i] = fArray[i]->newPictureSnapshot(); 25 pics[i] = fArray[i]->newPictureSnapshot();
25 } 26 }
26 return SkNEW_ARGS(SkPicture::SnapshotArray, (pics.detach(), count)); 27 return SkNEW_ARGS(SkBigPicture::SnapshotArray, (pics.detach(), count));
27 } 28 }
28 29
29 void SkDrawableList::append(SkDrawable* drawable) { 30 void SkDrawableList::append(SkDrawable* drawable) {
30 *fArray.append() = SkRef(drawable); 31 *fArray.append() = SkRef(drawable);
31 } 32 }
32 33
33 //////////////////////////////////////////////////////////////////////////////// /////////////// 34 //////////////////////////////////////////////////////////////////////////////// ///////////////
34 35
35 SkRecorder::SkRecorder(SkRecord* record, int width, int height) 36 SkRecorder::SkRecorder(SkRecord* record, int width, int height)
36 : SkCanvas(SkIRect::MakeWH(width, height), SkCanvas::kConservativeRasterClip _InitFlag) 37 : SkCanvas(SkIRect::MakeWH(width, height), SkCanvas::kConservativeRasterClip _InitFlag)
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 338 }
338 339
339 void SkRecorder::addComment(const char* key, const char* value) { 340 void SkRecorder::addComment(const char* key, const char* value) {
340 APPEND(AddComment, this->copy(key), this->copy(value)); 341 APPEND(AddComment, this->copy(key), this->copy(value));
341 } 342 }
342 343
343 void SkRecorder::endCommentGroup() { 344 void SkRecorder::endCommentGroup() {
344 APPEND(EndCommentGroup); 345 APPEND(EndCommentGroup);
345 } 346 }
346 347
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698