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
40ca1cea
Kaydet (Commit)
40ca1cea
authored
Eyl 26, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: remove tiles delayed by one redraw call
Change-Id: I5ab5e4a0ba9cdf3f3115c4913b4cf04e7f062755
üst
fd08f4fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
MultiTileLayer.java
...droid3/src/java/org/mozilla/gecko/gfx/MultiTileLayer.java
+22
-10
SubTile.java
...al/LOAndroid3/src/java/org/mozilla/gecko/gfx/SubTile.java
+6
-0
No files found.
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/MultiTileLayer.java
Dosyayı görüntüle @
40ca1cea
...
@@ -45,6 +45,7 @@ import android.graphics.Region;
...
@@ -45,6 +45,7 @@ import android.graphics.Region;
import
android.util.Log
;
import
android.util.Log
;
import
org.libreoffice.TileProvider
;
import
org.libreoffice.TileProvider
;
import
org.mozilla.gecko.util.FloatUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -230,7 +231,6 @@ public class MultiTileLayer extends Layer {
...
@@ -230,7 +231,6 @@ public class MultiTileLayer extends Layer {
public
void
reevaluateTiles
(
ImmutableViewportMetrics
viewportMetrics
)
{
public
void
reevaluateTiles
(
ImmutableViewportMetrics
viewportMetrics
)
{
if
(
currentZoomFactor
!=
viewportMetrics
.
zoomFactor
)
{
if
(
currentZoomFactor
!=
viewportMetrics
.
zoomFactor
)
{
currentZoomFactor
=
viewportMetrics
.
zoomFactor
;
currentZoomFactor
=
viewportMetrics
.
zoomFactor
;
mTiles
.
clear
();
}
}
RectF
newTileViewPort
=
inflate
(
roundToTileSize
(
viewportMetrics
.
getViewport
(),
TILE_SIZE
),
TILE_SIZE
);
RectF
newTileViewPort
=
inflate
(
roundToTileSize
(
viewportMetrics
.
getViewport
(),
TILE_SIZE
),
TILE_SIZE
);
...
@@ -239,11 +239,23 @@ public class MultiTileLayer extends Layer {
...
@@ -239,11 +239,23 @@ public class MultiTileLayer extends Layer {
if
(
tileViewPort
!=
newTileViewPort
)
{
if
(
tileViewPort
!=
newTileViewPort
)
{
tileViewPort
=
newTileViewPort
;
tileViewPort
=
newTileViewPort
;
clea
r
Tiles
();
clea
n
Tiles
();
addNewTiles
();
addNewTiles
();
markTiles
();
}
}
}
}
private
void
cleanTiles
()
{
List
<
SubTile
>
tilesToRemove
=
new
ArrayList
<
SubTile
>();
for
(
SubTile
tile
:
mTiles
)
{
if
(
tile
.
markedForRemoval
)
{
tile
.
destroy
();
tilesToRemove
.
add
(
tile
);
}
}
mTiles
.
removeAll
(
tilesToRemove
);
}
private
void
addNewTiles
()
{
private
void
addNewTiles
()
{
for
(
float
y
=
tileViewPort
.
top
;
y
<
tileViewPort
.
bottom
;
y
+=
TILE_SIZE
)
{
for
(
float
y
=
tileViewPort
.
top
;
y
<
tileViewPort
.
bottom
;
y
+=
TILE_SIZE
)
{
if
(
y
>
currentPageSize
.
height
)
{
if
(
y
>
currentPageSize
.
height
)
{
...
@@ -269,17 +281,17 @@ public class MultiTileLayer extends Layer {
...
@@ -269,17 +281,17 @@ public class MultiTileLayer extends Layer {
}
}
}
}
private
void
clearTiles
()
{
private
void
markTiles
()
{
ArrayList
<
SubTile
>
removeTiles
=
new
ArrayList
<
SubTile
>();
for
(
SubTile
tile
:
mTiles
)
{
for
(
SubTile
tile
:
mTiles
)
{
RectF
tileRect
=
new
RectF
(
tile
.
x
,
tile
.
y
,
tile
.
x
+
TILE_SIZE
,
tile
.
y
+
TILE_SIZE
);
if
(
FloatUtils
.
fuzzyEquals
(
tile
.
zoom
,
currentZoomFactor
))
{
if
(!
RectF
.
intersects
(
tileViewPort
,
tileRect
))
{
RectF
tileRect
=
new
RectF
(
tile
.
x
,
tile
.
y
,
tile
.
x
+
TILE_SIZE
,
tile
.
y
+
TILE_SIZE
);
tile
.
destroy
();
if
(!
RectF
.
intersects
(
tileViewPort
,
tileRect
))
{
removeTiles
.
add
(
tile
);
tile
.
markForRemoval
();
}
}
else
{
tile
.
markForRemoval
();
}
}
}
}
mTiles
.
removeAll
(
removeTiles
);
}
}
}
}
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/SubTile.java
Dosyayı görüntüle @
40ca1cea
...
@@ -10,10 +10,16 @@ public class SubTile extends SingleTileLayer {
...
@@ -10,10 +10,16 @@ public class SubTile extends SingleTileLayer {
public
int
y
;
public
int
y
;
public
float
zoom
;
public
float
zoom
;
public
boolean
markedForRemoval
=
false
;
public
SubTile
(
CairoImage
mImage
,
int
x
,
int
y
,
float
zoom
)
{
public
SubTile
(
CairoImage
mImage
,
int
x
,
int
y
,
float
zoom
)
{
super
(
mImage
);
super
(
mImage
);
this
.
x
=
x
;
this
.
x
=
x
;
this
.
y
=
y
;
this
.
y
=
y
;
this
.
zoom
=
zoom
;
this
.
zoom
=
zoom
;
}
}
public
void
markForRemoval
()
{
markedForRemoval
=
true
;
}
}
}
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