The picture rect logically belongs with the texture, and later patches will
make OpUseTexture take multiple textures, each of which needs its own
picture rect.
There is some ambiguity about whether ScheduleComposite will necessarily
trigger a composite all the way to nsWindow::DrawWindowUnderlay. Android
robocop tests assume it will, because they rely on DrawWindowOverlay
being called so they can take a screenshot and make progress,
but this is a very fragile assumption. They also rely on the entire
window being painted, which is also a fragile assumption.
This patch improves the situation by explicitly invalidating the current
window area when Android Java code needs to trigger a composite. This avoids
regressions from future patches in this series which make composition bail
out when there is nothing invalid.
The resulting setup is still a bit fragile for my taste but I'm not sure
what the ideal solution would be.
Otherwise we can get a crash with the following stack:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 14711]
0x5d99974e in mozilla::gl::GLContext::BeforeGLCall (this=0x6dbf0800,
funcName=0x60f251a4 <mozilla::gl::GLContext::raw_fDeleteProgram(unsigned int)::__PRETTY_FUNCTION__> "void mozilla::gl::GLContext::raw_fDeleteProgram(GLuint)") at /home/roc/mozilla-inbound/gfx/gl/GLContext.h:683
683 MOZ_ASSERT(IsCurrent());
(gdb) where
#0 0x5d99974e in mozilla::gl::GLContext::BeforeGLCall (this=0x6dbf0800,
funcName=0x60f251a4 <mozilla::gl::GLContext::raw_fDeleteProgram(unsigned int)::__PRETTY_FUNCTION__> "void mozilla::gl::GLContext::raw_fDeleteProgram(GLuint)") at /home/roc/mozilla-inbound/gfx/gl/GLContext.h:683
#1 0x5d99bed6 in mozilla::gl::GLContext::raw_fDeleteProgram (this=0x6dbf0800, program=210003)
at /home/roc/mozilla-inbound/gfx/gl/GLContext.h:2232
#2 0x5d99c10a in mozilla::gl::GLContext::fDeleteProgram (this=0x6dbf0800, program=210003)
at /home/roc/mozilla-inbound/gfx/gl/GLContext.h:2270
#3 0x5daa0ae6 in mozilla::layers::ShaderProgramOGL::~ShaderProgramOGL (this=0x6d7df000, __in_chrg=<optimized out>)
at /home/roc/mozilla-inbound/gfx/layers/opengl/OGLShaderProgram.cpp:491
#4 0x5da86bdc in mozilla::layers::CompositorOGL::CleanupResources (this=0x67ae4d70)
at /home/roc/mozilla-inbound/gfx/layers/opengl/CompositorOGL.cpp:177
On some Android versions, GraphicBuffer.h ends up including libui's
hardware.h, which #defines the symbols version_minor and version_major, which
are used as field names in Ogg Theora's th_info struct. Later patches will
require some files to include both Theora headers and LayerTypes.h.
Whenever the inverse of a 3D projective transform is applied to a point, only use the result if it has a positive w-coordinate.
When transforming by a matrix that we know should be 2D, assert to that effect.
Transformations of rectangles (as opposed to points) remain to be audited.
ClientTiledPaintedLayer::RenderLayer was returning false immediately if there was no callback. It should check if it actually has to draw anything first, and then if it needs to paint it can return false if there is no callback.