зеркало из https://github.com/mozilla/moz-skia.git
Grab-bag of memory fixes. SkFlatMatrix::Flatten had the same issue as
Sk2DPathEffect: it was encoding a partially-unintialized matrix type mask. The others are simply uninitialized vars in the sample code. Review URL: http://codereview.appspot.com/4539072/ git-svn-id: http://skia.googlecode.com/svn/trunk@1414 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
f4ff39ca48
Коммит
50108cdbfe
|
@ -186,6 +186,7 @@ class HairlineView : public SampleView {
|
|||
bool fDoAA;
|
||||
public:
|
||||
HairlineView() {
|
||||
fCounter = 0;
|
||||
fProcIndex = 0;
|
||||
fDoAA = true;
|
||||
fNow = 0;
|
||||
|
|
|
@ -166,6 +166,7 @@ public:
|
|||
LineClipperView() {
|
||||
fProcIndex = 0;
|
||||
fCounter = 0;
|
||||
fNow = 0;
|
||||
|
||||
int x = (640 - W)/2;
|
||||
int y = (480 - H)/2;
|
||||
|
|
|
@ -28,9 +28,9 @@ SkFlatBitmap* SkFlatBitmap::Flatten(SkChunkAlloc* heap, const SkBitmap& bitmap,
|
|||
}
|
||||
|
||||
SkFlatMatrix* SkFlatMatrix::Flatten(SkChunkAlloc* heap, const SkMatrix& matrix, int index) {
|
||||
int32_t size = sizeof(SkMatrix);
|
||||
size_t size = matrix.flatten(NULL);
|
||||
SkFlatMatrix* result = (SkFlatMatrix*) INHERITED::Alloc(heap, size, index);
|
||||
memcpy(&result->fMatrixData, &matrix, sizeof(SkMatrix));
|
||||
matrix.flatten(&result->fMatrixData);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче