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

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: Fix Android compiler issue 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
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifdef SK_BUILD_FOR_ANDROID
9 #include "SkPicturePlayback.h"
10 #endif
8 #include "SkPictureRecorder.h" 11 #include "SkPictureRecorder.h"
9 12
10 SkCanvas* SkPictureRecorder::beginRecording(int width, int height, 13 SkCanvas* SkPictureRecorder::beginRecording(int width, int height,
11 SkBBHFactory* bbhFactory /* = NULL * /, 14 SkBBHFactory* bbhFactory /* = NULL * /,
12 uint32_t recordFlags /* = 0 */) { 15 uint32_t recordFlags /* = 0 */) {
13 fPicture.reset(SkNEW(SkPicture)); 16 fPicture.reset(SkNEW(SkPicture));
14 return fPicture->beginRecording(width, height, bbhFactory, recordFlags); 17 return fPicture->beginRecording(width, height, bbhFactory, recordFlags);
15 } 18 }
19
20 #ifdef SK_BUILD_FOR_ANDROID
21 void SkPictureRecorder::partialReplay(SkCanvas* canvas) {
22 if (NULL == fPicture.get() || NULL == canvas) {
23 // Not recording or nothing to replay into
24 return;
25 }
26
27 SkASSERT(NULL != fPicture->fRecord);
28
29 SkAutoTDelete<SkPicturePlayback> playback(SkPicture::FakeEndRecording(fPictu re,
30 *fPict ure->fRecord,
31 false) );
32 playback->draw(*canvas, NULL);
33 }
34 #endif
OLDNEW
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698