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

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

Issue 252873005: add replay entry point to SkPictureRecorder for Android (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 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 | Annotate | Revision Log
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 "SkPicturePlayback.h"
scroggo 2014/04/30 20:05:43 Isn't this only for SK_BUILD_FOR_ANDROID?
8 #include "SkPictureRecorder.h" 9 #include "SkPictureRecorder.h"
9 10
10 SkCanvas* SkPictureRecorder::beginRecording(int width, int height, 11 SkCanvas* SkPictureRecorder::beginRecording(int width, int height,
11 SkBBHFactory* bbhFactory /* = NULL * /, 12 SkBBHFactory* bbhFactory /* = NULL * /,
12 uint32_t recordFlags /* = 0 */) { 13 uint32_t recordFlags /* = 0 */) {
13 fPicture.reset(SkNEW(SkPicture)); 14 fPicture.reset(SkNEW(SkPicture));
14 return fPicture->beginRecording(width, height, bbhFactory, recordFlags); 15 return fPicture->beginRecording(width, height, bbhFactory, recordFlags);
15 } 16 }
17
18 #ifdef SK_BUILD_FOR_ANDROID
19 void SkPictureRecorder::replay(SkCanvas* canvas) {
20 if (NULL == fPicture.get() || NULL == canvas) {
21 // Not recording or nothing to replay into
22 return;
23 }
24
25 SkASSERT(NULL != fPicture->fRecord);
26
27 SkPictInfo info;
28 fPicture->createHeader(&info);
29 // here we do a fake src.endRecording()
30 SkAutoTDelete<SkPicturePlayback> playback(SkNEW_ARGS(SkPicturePlayback, (fPi cture,
31 *fP icture->fRecord,
32 inf o)));
33 playback->draw(*canvas, NULL);
34 }
35 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698