Closed Bug 907109 Opened 11 years ago Closed 6 years ago

[B2G]LayerTree analysis for b2g homescreen

Categories

(Core :: Graphics: Layers, defect)

26 Branch
ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: pchang, Unassigned)

References

Details

The following are the layer tree dump from B2G homescreen scrolling.
I got the following three different layer trees.
a. scrolling between two pages
b. scrolling stop at one page 
   but homescreen tries to drawing the orange page index below status bar
c. scrolling stop at one page

a. scrolling between two pages
I/Gecko   ( 2410): HWComposer: FPS is 22.1384
I/Gecko   ( 2410):  aLayer 0x484a7400  in 0 name ContainerLayer fmt 0 vis(0 0 320 480) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8000  in 11 name ThebesLayerComposite fmt 0 vis(0 0 0 0) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8c00  in 12 name ColorLayer fmt 0 vis(0 0 0 0) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8400  in 13 name ContainerLayer fmt 0 vis(0 0 320 480) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):      aLayer 0x484a8800  in 24 name ThebesLayerComposite fmt 4 vis(0 0 320 480) sf(320 480) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 320 480) bufferrect (0 0 320 480) display (0 0 320 480)
//background image + include status bar
I/Gecko   ( 2410):      aLayer 0x475d9800  in 25 name RefLayer fmt 0 vis(0 0 320 460) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):        aLayer 0x475d6800  in 36 name ContainerLayer fmt 0 vis(0 0 320 460) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):          aLayer 0x475d6c00  in 47 name ThebesLayerComposite fmt 1 vis(0 0 320 460) sf(320 460) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 320 460) bufferrect (0 0 320 460) display (0 20 320 480)
//blending layer with background
I/Gecko   ( 2410):          aLayer 0x44e1fc00  in 48 name ContainerLayer fmt 0 vis(0 0 320 461) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):            aLayer 0x44ea2400  in 59 name ThebesLayerComposite fmt 1 vis(0 0 320 461) sf(320 461) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (319 0 320 460) bufferrect (0 0 320 461) display (0 20 1 480)
//When scrolling homescreen, we will see two icon pages and this is the left page of home screen
I/Gecko   ( 2410):          aLayer 0x46015000  in 49 name ContainerLayer fmt 0 vis(0 0 320 461) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):            aLayer 0x46978000  in 60 name ThebesLayerComposite fmt 1 vis(0 0 320 461) sf(320 461) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 319 460) bufferrect (0 0 320 461) display (1 20 320 480)
//When scrolling homescreen, we will see two icon pages and this is the right page of home screen
I/Gecko   ( 2410):          aLayer 0x4697ac00  in 50 name ThebesLayerComposite fmt 1 vis(0 0 320 460) sf(320 460) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 320 460) bufferrect (0 0 320 460) display (0 20 320 480)
//Bottom of screen to put phone/message/broswer

b. scrolling stop at one page but homescreen tries to drawing the orange page index below status bar
I/Gecko   ( 2410): HWComposer: FPS is 54.7484
I/Gecko   ( 2410):  aLayer 0x484a7400  in 0 name ContainerLayer fmt 0 vis(0 0 320 480) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8000  in 11 name ThebesLayerComposite fmt 0 vis(0 0 0 0) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8c00  in 12 name ColorLayer fmt 0 vis(0 0 0 0) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8400  in 13 name ContainerLayer fmt 0 vis(0 0 320 480) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):      aLayer 0x484a8800  in 24 name ThebesLayerComposite fmt 4 vis(0 0 320 480) sf(320 480) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 320 480) bufferrect (0 0 320 480) display (0 0 320 480)
I/Gecko   ( 2410):      aLayer 0x475d5400  in 25 name RefLayer fmt 0 vis(0 0 320 460) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):        aLayer 0x460a6800  in 36 name ContainerLayer fmt 0 vis(0 0 320 460) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):          aLayer 0x460a9400  in 47 name ThebesLayerComposite fmt 1 vis(0 0 320 460) sf(320 460) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 320 460) bufferrect (0 0 320 460) display (0 20 320 480)
//blending layer with background
I/Gecko   ( 2410):          aLayer 0x46080c00  in 48 name ContainerLayer fmt 0 vis(0 0 320 461) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):            aLayer 0x460a2400  in 59 name ThebesLayerComposite fmt 1 vis(0 0 320 461) sf(320 461) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 320 460) bufferrect (0 0 320 461) display (0 20 320 480)
//content iocons page
I/Gecko   ( 2410):          aLayer 0x460a5c00  in 49 name ContainerLayer fmt 0 vis(0 0 64 3) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):            aLayer 0x460a7000  in 60 name ThebesLayerComposite fmt 0 vis(0 0 0 0) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):            aLayer 0x460a8000  in 61 name ColorLayer fmt 0 vis(0 0 64 3) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 64 3) bufferrect (0 0 64 3) display (192 20 256 23)
//page index with orange color
I/Gecko   ( 2410):          aLayer 0x460a3800  in 50 name ThebesLayerComposite fmt 1 vis(0 385 320 75) sf(320 460) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 385 320 460) bufferrect (0 0 320 460) display (0 405 320 480)
//Bottom of screen to put phone/message/broswer

c. scrolling stop at one page
I/Gecko   ( 2410): HWComposer: FPS is 56.2396
I/Gecko   ( 2410):  aLayer 0x484a7400  in 0 name ContainerLayer fmt 0 vis(0 0 320 480) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8000  in 11 name ThebesLayerComposite fmt 0 vis(0 0 0 0) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8c00  in 12 name ColorLayer fmt 0 vis(0 0 0 0) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):    aLayer 0x484a8400  in 13 name ContainerLayer fmt 0 vis(0 0 320 480) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):      aLayer 0x484a8800  in 24 name ThebesLayerComposite fmt 4 vis(0 0 320 480) sf(320 480) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 320 480) bufferrect (0 0 320 480) display (0 0 320 480)
I/Gecko   ( 2410):      aLayer 0x475d5400  in 25 name RefLayer fmt 0 vis(0 0 320 460) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):        aLayer 0x460a6800  in 36 name ContainerLayer fmt 0 vis(0 0 320 460) sf(0 0) visReg xxx offset0 (0 0) opacity 1.00
I/Gecko   ( 2410):          aLayer 0x460a9400  in 47 name ThebesLayerComposite fmt 1 vis(0 0 320 460) sf(320 460) visReg xxx offset1 (0 0) opacity 1.00
I/Gecko   ( 2410): crop (0 0 320 460) bufferrect (0 0 320 460) display (0 20 320 480)
//full content pages include orange page index+ bootom of screen + content icons
put layertree dump to pastebin for better reading format

http://www.pastebin.mozilla.org/2887463
fmt above is the graphic buffer format from android.

PIXEL_FORMAT_RGBA_8888   = HAL_PIXEL_FORMAT_RGBA_8888,  // 4x8-bit RGBA    ==> 1
PIXEL_FORMAT_RGBX_8888   = HAL_PIXEL_FORMAT_RGBX_8888,  // 4x8-bit RGB0    ==> 2
PIXEL_FORMAT_RGB_888     = HAL_PIXEL_FORMAT_RGB_888,    // 3x8-bit RGB     ==> 3
PIXEL_FORMAT_RGB_565     = HAL_PIXEL_FORMAT_RGB_565,    // 16-bit RGB      ==> 4


Here, I will investigate two things.

a. Reduce the visible region of the bottom area for case a and case b.

          aLayer 0x460a3800  in 50 name ThebesLayerComposite fmt 1 vis(0 385 320 75) sf(320 460) visReg xxx offset1 (0 0) opacity 1.00
 crop (0 385 320 460) bufferrect (0 0 320 460) display (0 405 320 480)
//Bottom of screen to put phone/message/broswer

b. the necessary of blending layer for background for case a and b.

          aLayer 0x475d6c00  in 47 name ThebesLayerComposite fmt 1 vis(0 0 320 460) sf(320 460) visReg xxx offset1 (0 0) opacity 1.00
 crop (0 0 320 460) bufferrect (0 0 320 460) display (0 20 320 480)
//blending layer with background
Blocks: 907048
Peter, can you put a printf in ContainerLayerOGL.cpp and check what the scissor rect is that we calculate? Do we actually composite that layer? Or do we skip based on an empty scissor rect? It would be good to know this for each layer.
Also, we have to find out why we have a 461 and a 460 pixel tall layer there. That looks very odd.
Isn't the status bar 20, leaving 460?
Blocks: 908033
(In reply to Andreas Gal :gal from comment #3)
> Peter, can you put a printf in ContainerLayerOGL.cpp and check what the
> scissor rect is that we calculate? Do we actually composite that layer? Or
> do we skip based on an empty scissor rect? It would be good to know this for
> each layer.

Do you mean the following two layers?
ThebesLayerComposite fmt 0 vis(0 0 0 0)
ColorLayer fmt 0 vis(0 0 0 0)

We won't composite these two layers because empty visible region. I'm trying to dump the layer info which includes the scissor and src/dst rect under screen space.

http://mxr.mozilla.org/mozilla-central/source/gfx/layers/composite/ContainerLayerComposite.cpp#137
With latest gaia/gecko on m-c, the following are new layer tree dump for case a and b.

I didn't see the strange 460/461 pair anymore and also didn't see overpainting based on following layer tree.

Except one thing, the layer trees were different when scrolling page 1/2(page 1 is the page contains search bar) and page 2/3. It used colorlayer for blending with background. I'm checking the root cause for this behavior difference.

aLayer 0x47658000 in 300 name ContainerLayer fmt 0 cntflag 0x2 vis(0 0 320 460) sf(0 0) opacity 1.00
aLayer 0x48631400 in 301 name ThebesLayerComposite fmt 1 cntflag 0x1 vis(0 0 0 0) sf(320 460) opacity 1.00
aLayer 0x48631400 empty visibleRegion
  aLayer 0x470d9800 in 400 name ContainerLayer fmt 0 cntflag 0x1 vis(0 0 320 460) sf(0 0) opacity 0.05
  aLayer 0x470d9c00 in 401 name ThebesLayerComposite fmt 0 cntflag 0x0 vis(0 0 0 0) sf(0 0) opacity 0.05
  aLayer 0x470d9c00 empty visibleRegion
  aLayer 0x470da000 in 402 name ColorLayer fmt 0 cntflag 0x1 vis(0 0 320 460) sf(0 0) opacity 0.05
  aLayer 0x470da000 scissorRect(0 20 320 460)



[LayerTree dump]
a. scrolling between two pages
 composition start
  aLayer 0x439f3800 in   1 name ContainerLayer fmt 0 cntflag 0x1 vis(0 0 320 480) sf(0 0) opacity 1.00
  aLayer 0x439f4000 in   2 name ThebesLayerComposite fmt 0 cntflag 0x0 vis(0 0 0 0) sf(0 0) opacity 1.00
  aLayer 0x439f4000 empty visibleRegion
  aLayer 0x439f4c00 in   3 name ColorLayer fmt 0 cntflag 0x1 vis(0 0 0 0) sf(0 0) opacity 1.00
  aLayer 0x439f4c00 empty visibleRegion
    aLayer 0x439f4400 in 100 name ContainerLayer fmt 0 cntflag 0x1 vis(0 0 320 480) sf(0 0) opacity 1.00
    aLayer 0x439f4800 in 101 name ThebesLayerComposite fmt 4 cntflag 0x1 vis(0 0 320 480) sf(320 480) opacity 1.00
    aLayer 0x439f4800 scissorRect(0 0 320 480)
//background layer
      aLayer 0x48641c00 in 200 name RefLayer fmt 0 cntflag 0x0 vis(0 0 320 460) sf(0 0) opacity 1.00
        aLayer 0x47238400 in 300 name ContainerLayer fmt 0 cntflag 0x2 vis(0 0 320 460) sf(0 0) opacity 1.00
        aLayer 0x48631c00 in 301 name ThebesLayerComposite fmt 1 cntflag 0x0 vis(0 0 320 460) sf(320 460) opacity 1.00
        aLayer 0x48631c00 scissorRect(0 20 320 460)
//blending layer with background
          aLayer 0x475d4c00 in 400 name ContainerLayer fmt 0 cntflag 0xa vis(0 0 320 385) sf(0 0) opacity 1.00
          aLayer 0x47686c00 in 401 name ThebesLayerComposite fmt 1 cntflag 0x2 vis(0 0 320 385) sf(320 385) opacity 1.00
          aLayer 0x47686c00 scissorRect(0 20 320 460)
//left page
          aLayer 0x48460800 in 425 name ContainerLayer fmt 0 cntflag 0xa vis(0 0 320 385) sf(0 0) opacity 1.00
          aLayer 0x48460c00 in 426 name ThebesLayerComposite fmt 1 cntflag 0x2 vis(0 0 320 385) sf(320 385) opacity 1.00
          aLayer 0x48460c00 scissorRect(0 20 320 460)
//right page
        aLayer 0x48461000 in 302 name ThebesLayerComposite fmt 4 cntflag 0x1 vis(240 0 80 3) sf(80 3) opacity 1.00
        aLayer 0x48461000 scissorRect(0 20 320 460)
//page index


b. scrolling stop at one page 
   but homescreen tries to drawing the orange page index below status bar
 composition start
  aLayer 0x439f3800 in   1 name ContainerLayer fmt 0 cntflag 0x1 vis(0 0 320 480) sf(0 0) opacity 1.00
  aLayer 0x439f4000 in   2 name ThebesLayerComposite fmt 0 cntflag 0x0 vis(0 0 0 0) sf(0 0) opacity 1.00
  aLayer 0x439f4000 empty visibleRegion
  aLayer 0x439f4c00 in   3 name ColorLayer fmt 0 cntflag 0x1 vis(0 0 0 0) sf(0 0) opacity 1.00
  aLayer 0x439f4c00 empty visibleRegion
    aLayer 0x439f4400 in 100 name ContainerLayer fmt 0 cntflag 0x1 vis(0 0 320 480) sf(0 0) opacity 1.00
    aLayer 0x439f4800 in 101 name ThebesLayerComposite fmt 4 cntflag 0x1 vis(0 0 320 480) sf(320 480) opacity 1.00
    aLayer 0x439f4800 scissorRect(0 0 320 480)
//background layer
      aLayer 0x487f0000 in 200 name RefLayer fmt 0 cntflag 0x0 vis(0 0 320 460) sf(0 0) opacity 1.00
        aLayer 0x47658000 in 300 name ContainerLayer fmt 0 cntflag 0x2 vis(0 0 320 460) sf(0 0) opacity 1.00
        aLayer 0x48631400 in 301 name ThebesLayerComposite fmt 1 cntflag 0x0 vis(0 0 320 460) sf(320 460) opacity 1.00
        aLayer 0x48631400 scissorRect(0 20 320 460)
//blending layer with background
          aLayer 0x462c0c00 in 400 name ContainerLayer fmt 0 cntflag 0xa vis(0 0 320 385) sf(0 0) opacity 1.00
          aLayer 0x46875800 in 401 name ThebesLayerComposite fmt 1 cntflag 0x2 vis(0 0 320 385) sf(320 385) opacity 1.00
          aLayer 0x46875800 scissorRect(0 20 320 460)
//full left page
          aLayer 0x46877000 in 425 name ContainerLayer fmt 0 cntflag 0x9 vis(0 0 80 3) sf(0 0) opacity 1.00
          aLayer 0x46d1f400 in 426 name ThebesLayerComposite fmt 0 cntflag 0x0 vis(0 0 0 0) sf(0 0) opacity 1.00
          aLayer 0x46d1f400 empty visibleRegion
//set right page as invisible
          aLayer 0x46d21400 in 427 name ColorLayer fmt 0 cntflag 0x1 vis(0 0 80 3) sf(0 0) opacity 1.00
          aLayer 0x46d21400 scissorRect(0 20 320 460)
//drawing page index
Can you use the built-in LayerManager::Dump methods instead of writing your own? That has complete information and is easier to read. Thanks!

Also dumping display lists would be helpful. MOZ_DUMP_PAINT_LIST=1
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #8)
> Can you use the built-in LayerManager::Dump methods instead of writing your
> own? That has complete information and is easier to read. Thanks!
> 
> Also dumping display lists would be helpful. MOZ_DUMP_PAINT_LIST=1

I just dump the layer tree from built-in dump method.
Will update display list soon.

a. scrolling between two pages
  LayerManager (0x46c24200)
    ContainerLayerComposite (0x4841c800) [shadow-visible=< (x=0, y=0, w=320, h=480); >] [visible=< (x=0, y=0, w=320, h=480); >] [opaqueContent] [metrics={ viewport=(x=0.000000, y=0.000000, w=320.000000, h=480.000000) viewportScroll=(x=0.000000, y=0.000000) displayport=(x=0.000000, y=0.000000, w=0.000000, h=0.000000) scrollId=0 }]
      ThebesLayerComposite (0x48421c00) [shadow-clip=(x=0, y=0, w=0, h=0)] [clip=(x=0, y=0, w=0, h=0)] [not visible] [isFixedPosition anchor=0.000000,0.000000]

      ColorLayerComposite (0x48422800) [not visible] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000] [color=rgba(0, 0, 0, 1)]
      ContainerLayerComposite (0x48422000) [shadow-clip=(x=0, y=0, w=320, h=480)] [shadow-visible=< (x=0, y=0, w=320, h=480); >] [clip=(x=0, y=0, w=320, h=480)] [visible=< (x=0, y=0, w=320, h=480); >] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000]
        ThebesLayerComposite (0x48422400) [shadow-visible=< (x=0, y=0, w=320, h=480); >] [visible=< (x=0, y=0, w=320, h=480); >] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000] [valid=< (x=0, y=0, w=320, h=480); >]
          ContentHostDoubleBuffered (0x442f8bc0) [buffer-rect=(x=0, y=0, w=320, h=480)] [buffer-rotation=(x=0, y=0)]
            GrallocDeprecatedTextureHostOGL (0x4760ab80) [size=(width=320, height=480)] [format=FORMAT_R5G6B5] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
            GrallocDeprecatedTextureHostOGL (0x4760ab50) [size=(width=320, height=480)] [format=FORMAT_R5G6B5] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
        RefLayerComposite (0x46cc5000) [shadow-clip=(x=0, y=20, w=320, h=460)] [shadow-transform=[ 1 0; 0 1; 0 20; ]] [shadow-visible=< (x=0, y=0, w=320, h=460); >] [clip=(x=0, y=20, w=320, h=460)] [transform=[ 1 0; 0 1; 0 20; ]] [visible=< (x=0, y=0, w=320, h=460); >] [isFixedPosition anchor=0.000000,0.000000] [id=2]
          ContainerLayerComposite (0x434bc000) [shadow-visible=< (x=0, y=0, w=320, h=460); >] [visible=< (x=0, y=0, w=320, h=460); >] [componentAlpha] [metrics={ viewport=(x=0.000000, y=0.000000, w=320.000000, h=460.000000) viewportScroll=(x=0.000000, y=0.000000) displayport=(x=0.000000, y=0.000000, w=0.000000, h=0.000000) scrollId=1 }]
            ThebesLayerComposite (0x46cc2800) [shadow-visible=< (x=0, y=0, w=320, h=460); >] [visible=< (x=0, y=0, w=320, h=460); >] [isFixedPosition anchor=0.000000,0.000000] [valid=< (x=0, y=0, w=320, h=460); >]
              ContentHostDoubleBuffered (0x46171dc0) [buffer-rect=(x=0, y=0, w=320, h=460)] [buffer-rotation=(x=0, y=0)]
                GrallocDeprecatedTextureHostOGL (0x46126c10) [size=(width=320, height=460)] [format=FORMAT_B8G8R8A8] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
                GrallocDeprecatedTextureHostOGL (0x46126c40) [size=(width=320, height=460)] [format=FORMAT_B8G8R8A8] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
            ContainerLayerComposite (0x46cc4000) [shadow-clip=(x=0, y=0, w=320, h=460)] [shadow-transform=[ 1 0; 0 1; -219 0; ]] [shadow-visible=< (x=0, y=0, w=320, h=385); >] [clip=(x=0, y=0, w=320, h=460)] [transform=[ 1 0; 0 1; -219 0; ]] [visible=< (x=0, y=0, w=320, h=385); >] [componentAlpha] [isFixedPosition anchor=0.000000,0.000000]
              ThebesLayerComposite (0x46cc4400) [shadow-visible=< (x=0, y=0, w=320, h=385); >] [visible=< (x=0, y=0, w=320, h=385); >] [componentAlpha] [isFixedPosition anchor=0.000000,0.000000] [valid=< (x=0, y=0, w=320, h=385); >]
                ContentHostDoubleBuffered (0x442f8e00) [buffer-rect=(x=0, y=0, w=320, h=385)] [buffer-rotation=(x=0, y=0)] [paint-will-resample]
                  GrallocDeprecatedTextureHostOGL (0x456c6af0) [size=(width=320, height=385)] [format=FORMAT_B8G8R8A8] [flags=TEXTURE_DEALLOCATE_HOST]
                  GrallocDeprecatedTextureHostOGL (0x44299790) [size=(width=0, height=0)] [format=FORMAT_UNKNOWN] [flags=TEXTURE_DEALLOCATE_HOST]
            ContainerLayerComposite (0x46cc7000) [shadow-clip=(x=0, y=0, w=320, h=460)] [shadow-transform=[ 1 0; 0 1; 101 0; ]] [shadow-visible=< (x=0, y=0, w=320, h=385); >] [clip=(x=0, y=0, w=320, h=460)] [transform=[ 1 0; 0 1; 101 0; ]] [visible=< (x=0, y=0, w=320, h=385); >] [componentAlpha] [isFixedPosition anchor=0.000000,0.000000]
              ThebesLayerComposite (0x46cc7c00) [shadow-visible=< (x=0, y=0, w=320, h=385); >] [visible=< (x=0, y=0, w=320, h=385); >] [componentAlpha] [isFixedPosition anchor=0.000000,0.000000] [valid=< (x=0, y=0, w=320, h=385); >]
                ContentHostDoubleBuffered (0x442f8f20) [buffer-rect=(x=0, y=0, w=320, h=385)] [buffer-rotation=(x=0, y=0)] [paint-will-resample]
                  GrallocDeprecatedTextureHostOGL (0x456c6b50) [size=(width=320, height=385)] [format=FORMAT_B8G8R8A8] [flags=TEXTURE_DEALLOCATE_HOST]
                  GrallocDeprecatedTextureHostOGL (0x456c6b20) [size=(width=0, height=0)] [format=FORMAT_UNKNOWN] [flags=TEXTURE_DEALLOCATE_HOST]
            ThebesLayerComposite (0x46cc8000) [shadow-visible=< (x=160, y=0, w=80, h=3); >] [visible=< (x=160, y=0, w=80, h=3); >] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000] [valid=< (x=160, y=0, w=80, h=3); >]
              ContentHostDoubleBuffered (0x442f8fb0) [buffer-rect=(x=160, y=0, w=80, h=3)] [buffer-rotation=(x=0, y=0)]
                GrallocDeprecatedTextureHostOGL (0x456c6bb0) [size=(width=80, height=3)] [format=FORMAT_R5G6B5] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
                GrallocDeprecatedTextureHostOGL (0x456c6b80) [size=(width=0, height=0)] [format=FORMAT_UNKNOWN] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]


b. scrolling stop at one page 
   but homescreen tries to drawing the orange page index below status bar
  LayerManager (0x46c24200)
    ContainerLayerComposite (0x4841c800) [shadow-visible=< (x=0, y=0, w=320, h=480); >] [visible=< (x=0, y=0, w=320, h=480); >] [opaqueContent] [metrics={ viewport=(x=0.000000, y=0.000000, w=320.000000, h=480.000000) viewportScroll=(x=0.000000, y=0.000000) displayport=(x=0.000000, y=0.000000, w=0.000000, h=0.000000) scrollId=0 }]
      ThebesLayerComposite (0x48421c00) [shadow-clip=(x=0, y=0, w=0, h=0)] [clip=(x=0, y=0, w=0, h=0)] [not visible] [isFixedPosition anchor=0.000000,0.000000]

      ColorLayerComposite (0x48422800) [not visible] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000] [color=rgba(0, 0, 0, 1)]
      ContainerLayerComposite (0x48422000) [shadow-clip=(x=0, y=0, w=320, h=480)] [shadow-visible=< (x=0, y=0, w=320, h=480); >] [clip=(x=0, y=0, w=320, h=480)] [visible=< (x=0, y=0, w=320, h=480); >] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000]
        ThebesLayerComposite (0x48422400) [shadow-visible=< (x=0, y=0, w=320, h=480); >] [visible=< (x=0, y=0, w=320, h=480); >] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000] [valid=< (x=0, y=0, w=320, h=480); >]
          ContentHostDoubleBuffered (0x442f8bc0) [buffer-rect=(x=0, y=0, w=320, h=480)] [buffer-rotation=(x=0, y=0)]
            GrallocDeprecatedTextureHostOGL (0x4760ab80) [size=(width=320, height=480)] [format=FORMAT_R5G6B5] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
            GrallocDeprecatedTextureHostOGL (0x4760ab50) [size=(width=320, height=480)] [format=FORMAT_R5G6B5] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
        RefLayerComposite (0x46cc5000) [shadow-clip=(x=0, y=20, w=320, h=460)] [shadow-transform=[ 1 0; 0 1; 0 20; ]] [shadow-visible=< (x=0, y=0, w=320, h=460); >] [clip=(x=0, y=20, w=320, h=460)] [transform=[ 1 0; 0 1; 0 20; ]] [visible=< (x=0, y=0, w=320, h=460); >] [isFixedPosition anchor=0.000000,0.000000] [id=2]
          ContainerLayerComposite (0x434bc000) [shadow-visible=< (x=0, y=0, w=320, h=460); >] [visible=< (x=0, y=0, w=320, h=460); >] [componentAlpha] [metrics={ viewport=(x=0.000000, y=0.000000, w=320.000000, h=460.000000) viewportScroll=(x=0.000000, y=0.000000) displayport=(x=0.000000, y=0.000000, w=0.000000, h=0.000000) scrollId=1 }]
            ThebesLayerComposite (0x46cc2800) [shadow-visible=< (x=0, y=0, w=320, h=460); >] [visible=< (x=0, y=0, w=320, h=460); >] [isFixedPosition anchor=0.000000,0.000000] [valid=< (x=0, y=0, w=320, h=460); >]
              ContentHostDoubleBuffered (0x46171dc0) [buffer-rect=(x=0, y=0, w=320, h=460)] [buffer-rotation=(x=0, y=0)]
                GrallocDeprecatedTextureHostOGL (0x46126c10) [size=(width=320, height=460)] [format=FORMAT_B8G8R8A8] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
                GrallocDeprecatedTextureHostOGL (0x46126c40) [size=(width=320, height=460)] [format=FORMAT_B8G8R8A8] [flags=TEXTURE_USE_NEAREST_FILTER|TEXTURE_DEALLOCATE_HOST]
            ContainerLayerComposite (0x46cc9c00) [shadow-clip=(x=0, y=0, w=320, h=460)] [shadow-visible=< (x=0, y=0, w=320, h=385); >] [clip=(x=0, y=0, w=320, h=460)] [visible=< (x=0, y=0, w=320, h=385); >] [componentAlpha] [isFixedPosition anchor=0.000000,0.000000]
              ThebesLayerComposite (0x46cfb800) [shadow-visible=< (x=0, y=0, w=320, h=385); >] [visible=< (x=0, y=0, w=320, h=385); >] [componentAlpha] [isFixedPosition anchor=0.000000,0.000000] [valid=< (x=0, y=0, w=320, h=385); >]
                ContentHostDoubleBuffered (0x436561a0) [buffer-rect=(x=0, y=0, w=320, h=385)] [buffer-rotation=(x=0, y=0)] [paint-will-resample]
                  GrallocDeprecatedTextureHostOGL (0x46126be0) [size=(width=320, height=385)] [format=FORMAT_B8G8R8A8] [flags=TEXTURE_DEALLOCATE_HOST]
                  GrallocDeprecatedTextureHostOGL (0x46126bb0) [size=(width=0, height=0)] [format=FORMAT_UNKNOWN] [flags=TEXTURE_DEALLOCATE_HOST]
            ContainerLayerComposite (0x47159000) [shadow-clip=(x=0, y=0, w=320, h=460)] [shadow-transform=[ 1 0; 0 1; 240 0; ]] [shadow-visible=< (x=0, y=0, w=80, h=3); >] [clip=(x=0, y=0, w=320, h=460)] [transform=[ 1 0; 0 1; 240 0; ]] [visible=< (x=0, y=0, w=80, h=3); >] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000]
              ThebesLayerComposite (0x4715cc00) [shadow-clip=(x=0, y=0, w=0, h=0)] [clip=(x=0, y=0, w=0, h=0)] [not visible] [isFixedPosition anchor=0.000000,0.000000]

              ColorLayerComposite (0x4715ec00) [shadow-visible=< (x=0, y=0, w=80, h=3); >] [visible=< (x=0, y=0, w=80, h=3); >] [opaqueContent] [isFixedPosition anchor=0.000000,0.000000] [color=rgba(255, 127, 2, 1)]
OK. In that dump, which layers are being painted that shouldn't be?
1. <Background> ThebesLayerComposite (0x48422400) [shadow-visible=< (x=0, y=0, w=320, h=480); >]
2. <Blending>   ThebesLayerComposite (0x46cc2800) [shadow-visible=< (x=0, y=0, w=320, h=460); >]
3. <Left page>  ThebesLayerComposite (0x46cc4400) [shadow-visible=< (x=0, y=0, w=320, h=385); >]
4. <Right page> ThebesLayerComposite (0x46cc7c00) [shadow-visible=< (x=0, y=0, w=320, h=385); >] 
5. <Indicator>  ThebesLayerComposite (0x46cc8000) [shadow-visible=< (x=160, y=0, w=80, h=3); >]

Every layer are need. 
#3 + #4 = one full screen draw.
#1 = one full screen draw
#2 = one full screen draw
#5 is pretty minor, let's skip this tiny layer.

Totally, 3 full screen overdraw. 
a. In most modern device, GPU/ memory bus is capable to handle 3 full screen overdraw.
b. if we can use HWComposer in this scenario, overdraw is not a big problem even on low end, with low memory throughput, device, since HWC shade pixel into the buffer in display driver, which save FB0 write throuthput need in GLComposer.
c. #2 is not really need if we can change css rule while scrolling. If we can remove #2 and #5, we can use generic HWC. 
d. if we really need a blending effect, is there a way that we can do it in pixel shader, instead of use a blending layer?
Thanks! This is very helpful.

(In reply to C.J. Ku[:CJKu] from comment #11)
> 2. <Blending>   ThebesLayerComposite (0x46cc2800) [shadow-visible=< (x=0,
> y=0, w=320, h=460); >]

This is what makes the screen get darker as you swipe from the page with the time to the first page with the app icons?

Do you know why this is a ThebesLayer? It looks to me like every pixel of this overlay layer should be the same color, so shouldn't it be a ColorLayer?

> c. #2 is not really need if we can change css rule while scrolling. If we
> can remove #2 and #5, we can use generic HWC. 
> d. if we really need a blending effect, is there a way that we can do it in
> pixel shader, instead of use a blending layer?

I guess what you need here is CSS Filters (e.g. filter:brightness(0.4) ), not CSS blend modes (http://dev.w3.org/fxtf/compositing-1/#mix-blend-mode) since mix-blend-mode doesn't let us do gradual darkening. So to replace that overlay layer with a shader on the background layer, we need CSS Filters.

Anyway it looks like scissor rects and occlusion culling do not apply in this case, since no layers are hidden by transparent layers.
#3 + #4 = one full screen blending in merge stage and one or two full screen pixel shading in pixel shading stage.
Depend on implementaion of GL driver, (#3 + #4) may be equal to 2 full screen pixel shading if there is no cliping support in geometry stage.

BTW, the purpose of Bug 909192 is to provide a tool to dump layer three on the fly. With the tool, every devoloper should be able to dump a layer three with more semantical/visual-wise terms when he want to.
(In reply to C.J. Ku[:CJKu] from comment #13)
> #3 + #4 = one full screen blending in merge stage and one or two full screen
> pixel shading in pixel shading stage.
> Depend on implementaion of GL driver, (#3 + #4) may be equal to 2 full
> screen pixel shading if there is no cliping support in geometry stage.

I don't quite understand what you mean here. Do you mean that even if we draw #3 using a quad that covers only the left side of the framebuffer, and we draw #4 using a quad that covers the rest of the framebuffer, we may do work equivalent to compositing over every pixel of the framebuffer twice?
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #12)
> Thanks! This is very helpful.
> 
> (In reply to C.J. Ku[:CJKu] from comment #11)
> > 2. <Blending>   ThebesLayerComposite (0x46cc2800) [shadow-visible=< (x=0,
> > y=0, w=320, h=460); >]
> 
> This is what makes the screen get darker as you swipe from the page with the
> time to the first page with the app icons?
> 
Yes, it makes the screen get darker and also contains the bottom of screen(phone/message... icons).
Therefore, I think it becomes a ThebesLayer.

> Do you know why this is a ThebesLayer? It looks to me like every pixel of
> this overlay layer should be the same color, so shouldn't it be a ColorLayer?
> 
> > c. #2 is not really need if we can change css rule while scrolling. If we
> > can remove #2 and #5, we can use generic HWC. 
> > d. if we really need a blending effect, is there a way that we can do it in
> > pixel shader, instead of use a blending layer?
> 
> I guess what you need here is CSS Filters (e.g. filter:brightness(0.4) ),
> not CSS blend modes (http://dev.w3.org/fxtf/compositing-1/#mix-blend-mode)
> since mix-blend-mode doesn't let us do gradual darkening. So to replace that
> overlay layer with a shader on the background layer, we need CSS Filters.
> 
> Anyway it looks like scissor rects and occlusion culling do not apply in
> this case, since no layers are hidden by transparent layers.
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #14)
> (In reply to C.J. Ku[:CJKu] from comment #13)
> > #3 + #4 = one full screen blending in merge stage and one or two full screen
> > pixel shading in pixel shading stage.
> > Depend on implementaion of GL driver, (#3 + #4) may be equal to 2 full
> > screen pixel shading if there is no cliping support in geometry stage.
> 
> I don't quite understand what you mean here. Do you mean that even if we
> draw #3 using a quad that covers only the left side of the framebuffer, and
> we draw #4 using a quad that covers the rest of the framebuffer, we may do
> work equivalent to compositing over every pixel of the framebuffer twice?
Depend on implementation of raterizer.
If we have runtime clip support in geometry stage, rasterizer does not need to validate whether a pixel is valid. Without clipping in GEOM stage, rasterizer need to validate per-pixel while rasterizeing before send that pixel into pixel shader stage, which means operation in raterizer is heavier in this case. In my experience, I never met raterizer bound, even I met, I may not know that since there is no profiler, andreno or PerfHUD, will report this data, rasterizer_busy, to user. 

My previous comment is not correct, please ignore, sorry.
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #12)
> > c. #2 is not really need if we can change css rule while scrolling. If we
> > can remove #2 and #5, we can use generic HWC. 
> > d. if we really need a blending effect, is there a way that we can do it in
> > pixel shader, instead of use a blending layer?
> 
> I guess what you need here is CSS Filters (e.g. filter:brightness(0.4) ),
> not CSS blend modes (http://dev.w3.org/fxtf/compositing-1/#mix-blend-mode)
> since mix-blend-mode doesn't let us do gradual darkening. So to replace that
> overlay layer with a shader on the background layer, we need CSS Filters.
Thanks for this info.
Loop in KanRu.
Closing as we are not working on Firefox OS anymore.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.