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
0ab9ddaf
Kaydet (Commit)
0ab9ddaf
authored
Eyl 24, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: LayerRenderer - use highp and flip in vertex shader
Change-Id: Ia517b0d94fdfb3f8fdd9b9c383c8fb337173932c
üst
f789cd42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
LayerRenderer.java
...ndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+14
-6
No files found.
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
Dosyayı görüntüle @
0ab9ddaf
...
@@ -99,6 +99,11 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
...
@@ -99,6 +99,11 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
// The shaders run on the GPU directly, the vertex shader is only applying the
// The shaders run on the GPU directly, the vertex shader is only applying the
// matrix transform detailed above
// matrix transform detailed above
// Note we flip the y-coordinate in the vertex shader from a
// coordinate system with (0,0) in the top left to one with (0,0) in
// the bottom left.
public
static
final
String
DEFAULT_VERTEX_SHADER
=
public
static
final
String
DEFAULT_VERTEX_SHADER
=
"uniform mat4 uTMatrix;\n"
+
"uniform mat4 uTMatrix;\n"
+
"attribute vec4 vPosition;\n"
+
"attribute vec4 vPosition;\n"
+
...
@@ -106,18 +111,21 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
...
@@ -106,18 +111,21 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
"varying vec2 vTexCoord;\n"
+
"varying vec2 vTexCoord;\n"
+
"void main() {\n"
+
"void main() {\n"
+
" gl_Position = uTMatrix * vPosition;\n"
+
" gl_Position = uTMatrix * vPosition;\n"
+
" vTexCoord = aTexCoord;\n"
+
" vTexCoord.x = aTexCoord.x;\n"
+
" vTexCoord.y = 1.0 - aTexCoord.y;\n"
+
"}\n"
;
"}\n"
;
// Note we flip the y-coordinate in the fragment shader from a
// We use highp because the screenshot textures
// coordinate system with (0,0) in the top left to one with (0,0) in
// we use are large and we stretch them alot
// the bottom left.
// so we need all the precision we can get.
// Unfortunately, highp is not required by ES 2.0
// so on GPU's like Mali we end up getting mediump
public
static
final
String
DEFAULT_FRAGMENT_SHADER
=
public
static
final
String
DEFAULT_FRAGMENT_SHADER
=
"precision
medium
p float;\n"
+
"precision
high
p float;\n"
+
"varying vec2 vTexCoord;\n"
+
"varying vec2 vTexCoord;\n"
+
"uniform sampler2D sTexture;\n"
+
"uniform sampler2D sTexture;\n"
+
"void main() {\n"
+
"void main() {\n"
+
" gl_FragColor = texture2D(sTexture, v
ec2(vTexCoord.x, 1.0 - vTexCoord.y)
);\n"
+
" gl_FragColor = texture2D(sTexture, v
TexCoord
);\n"
+
"}\n"
;
"}\n"
;
public
void
setCheckerboardBitmap
(
Bitmap
bitmap
,
float
pageWidth
,
float
pageHeight
)
{
public
void
setCheckerboardBitmap
(
Bitmap
bitmap
,
float
pageWidth
,
float
pageHeight
)
{
...
...
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