diff options
| author | John Reck <jreck@google.com> | 2014-07-17 10:30:22 -0700 |
|---|---|---|
| committer | John Reck <jreck@google.com> | 2014-07-17 17:36:24 +0000 |
| commit | 580ff8142b7d0455d0d41ee77572b4f55dd935f0 (patch) | |
| tree | e6add1358ba52db2784f488cc23835980be2cf26 /core/jni/android/graphics/Picture.cpp | |
| parent | 4fc90de51b58771c079f2e0d51d15abd28a5015b (diff) | |
| download | frameworks_base-580ff8142b7d0455d0d41ee77572b4f55dd935f0.zip frameworks_base-580ff8142b7d0455d0d41ee77572b4f55dd935f0.tar.gz frameworks_base-580ff8142b7d0455d0d41ee77572b4f55dd935f0.tar.bz2 | |
Revert "Separate Canvas JNI code from the implementation."
This reverts commit e28a5afee885cd69a5be5809f88116b601cb1a72.
Appears to cause memory corruption and random appearances of
chinese
Bug: 16343240
Bug: 16336642
Change-Id: Ife169181f40adff4b12948ed5f9d3a88dcec935b
Diffstat (limited to 'core/jni/android/graphics/Picture.cpp')
| -rw-r--r-- | core/jni/android/graphics/Picture.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/jni/android/graphics/Picture.cpp b/core/jni/android/graphics/Picture.cpp index d214575..bc0c25f 100644 --- a/core/jni/android/graphics/Picture.cpp +++ b/core/jni/android/graphics/Picture.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "Canvas.h" #include "Picture.h" +#include "SkCanvas.h" #include "SkStream.h" namespace android { @@ -36,13 +36,12 @@ Picture::Picture(const Picture* src) { } } -Canvas* Picture::beginRecording(int width, int height) { +SkCanvas* Picture::beginRecording(int width, int height) { mPicture.reset(NULL); mRecorder.reset(new SkPictureRecorder); mWidth = width; mHeight = height; - SkCanvas* canvas = mRecorder->beginRecording(width, height, NULL, 0); - return Canvas::create_canvas(canvas); + return mRecorder->beginRecording(width, height, NULL, 0); } void Picture::endRecording() { @@ -94,14 +93,14 @@ void Picture::serialize(SkWStream* stream) const { } } -void Picture::draw(Canvas* canvas) { +void Picture::draw(SkCanvas* canvas) { if (NULL != mRecorder.get()) { this->endRecording(); SkASSERT(NULL != mPicture.get()); } if (NULL != mPicture.get()) { // TODO: remove this const_cast once pictures are immutable - const_cast<SkPicture*>(mPicture.get())->draw(canvas->getSkCanvas()); + const_cast<SkPicture*>(mPicture.get())->draw(canvas); } } |
