blob: 1589ec0536a0cb64e07690c0db419fe815046957 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
// Need to include SkTypes first, so that SK_BUILD_FOR_ANDROID is defined.
#include "SkTypes.h"
#ifdef SK_BUILD_FOR_ANDROID
#include "SkPicturePlayback.h"
#endif
#include "SkPictureRecorder.h"
SkCanvas* SkPictureRecorder::beginRecording(int width, int height,
SkBBHFactory* bbhFactory /* = NULL */,
uint32_t recordFlags /* = 0 */) {
fPicture.reset(SkNEW(SkPicture));
return fPicture->beginRecording(width, height, bbhFactory, recordFlags);
}
#ifdef SK_BUILD_FOR_ANDROID
void SkPictureRecorder::partialReplay(SkCanvas* canvas) const {
if (NULL == fPicture.get() || NULL == canvas) {
// Not recording or nothing to replay into
return;
}
SkASSERT(NULL != fPicture->fRecord);
SkAutoTDelete<SkPicturePlayback> playback(SkPicture::FakeEndRecording(fPicture.get(),
*fPicture->fRecord,
false));
playback->draw(*canvas, NULL);
}
#endif
|