Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a5e2c361
Kaydet (Commit)
a5e2c361
authored
Ock 15, 2015
tarafından
Tomaž Vajngerl
Kaydeden (comit)
Miklos Vajna
Ock 16, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: guard buffer allocation and return null if alloc. fails
Change-Id: I684c7af245cc755b94f69e175c652d161e0f643a
üst
1e4f6eeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
DirectBufferAllocator.java
...tstrap/src/org/libreoffice/kit/DirectBufferAllocator.java
+10
-0
LOKitTileProvider.java
...OAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+5
-1
No files found.
android/Bootstrap/src/org/libreoffice/kit/DirectBufferAllocator.java
Dosyayı görüntüle @
a5e2c361
...
...
@@ -87,4 +87,14 @@ public final class DirectBufferAllocator {
// can't free buffer - leave this to the VM
return
null
;
}
public
static
ByteBuffer
guardedAllocate
(
int
size
)
{
ByteBuffer
buffer
=
null
;
try
{
buffer
=
allocate
(
size
);
}
catch
(
OutOfMemoryError
oomException
)
{
return
null
;
}
return
buffer
;
}
}
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
Dosyayı görüntüle @
a5e2c361
...
...
@@ -4,6 +4,7 @@ import android.graphics.Bitmap;
import
android.graphics.RectF
;
import
android.util.Log
;
import
org.libreoffice.kit.DirectBufferAllocator
;
import
org.libreoffice.kit.Document
;
import
org.libreoffice.kit.LibreOfficeKit
;
import
org.libreoffice.kit.Office
;
...
...
@@ -189,7 +190,10 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback
@Override
public
CairoImage
createTile
(
float
x
,
float
y
,
IntSize
tileSize
,
float
zoom
)
{
ByteBuffer
buffer
=
ByteBuffer
.
allocateDirect
(
tileSize
.
width
*
tileSize
.
height
*
4
);
ByteBuffer
buffer
=
DirectBufferAllocator
.
guardedAllocate
(
tileSize
.
width
*
tileSize
.
height
*
4
);
if
(
buffer
==
null
)
return
null
;
CairoImage
image
=
new
BufferedCairoImage
(
buffer
,
tileSize
.
width
,
tileSize
.
height
,
CairoImage
.
FORMAT_ARGB32
);
rerenderTile
(
image
,
x
,
y
,
tileSize
,
zoom
);
return
image
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment