diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Canvas.java --- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Canvas.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Canvas.java Wed Sep 15 12:05:25 2010 +0300 @@ -61,7 +61,8 @@ private static final int ATTRIB_HEIGHT_INDEX = 2; private static final int ATTRIB_NATIVE_FRAME_BUFFER_INDEX = 3; private static final int ATTRIB_BACKGROUND_INDEX = 4; - private static final int ATTRIB_COUNT = 5; + private static final int ATTRIB_VIDEO_OVERLAY_INDEX = 5; + private static final int ATTRIB_COUNT = 6; /** * Static constants for media key keycodes @@ -94,6 +95,7 @@ * attribute is "CanvasHasBackground". The attribute may be placed in the JAD or the manifest. */ private boolean iHasBackgroundImage; + private boolean iVideoOverlayEnabled; private boolean iIsGameCanvas; private Object iPaintLock; @@ -133,6 +135,9 @@ iHasBackgroundImage = (canvasAttribs[ATTRIB_BACKGROUND_INDEX] != 0); + iVideoOverlayEnabled = + (canvasAttribs[ATTRIB_VIDEO_OVERLAY_INDEX] != 0); + // If is Toolkit activated, we can add Displayable to Vector // Displayables are removed from Vector when SizeChangedEvent arrives see Displayable.sizeChangedEvent() if (iToolkit.activated) @@ -446,6 +451,16 @@ { drawBackground(true); } + + if (iVideoOverlayEnabled) + { + // Send op code to native canvas about the start of paint, + // to enable overlays. This is done after + // drawBackground() so that framebuffer can be cleared + // correctly on native side. + iToolkit.canvasPaintStarted(getContentHandle()); + } + paint(graphics); }