[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] JDK-8068529 XSync when xrender is turned off
From:       Clemens Eisserer <linuxhippy () gmail ! com>
Date:       2015-01-23 11:04:52
Message-ID: CAFvQSYTZtGMQwNpxBEfaJ1uBBKyjc+gC9Or0Z+42Fa-x7q0f8Q () mail ! gmail ! com
[Download RAW message or body]

Hi Sergey,


> Is there a reason why AWT doesn't explicitly flush and whythe
>> flush-after-blit approach was chosen?
>>
> If a sync will be implemented in a Swing, then will be necessary to add a
> sync to all places where we paint an images to the screen, and this is
> equivalent of current solution, no?


Instead of thinking on the j2d level (blits), wouldn't it be enough to
flush after handling of events that can possibly issue paint-operations to
screen?
This would also have the advantage to have contents flushed to screen even
for the non-doublebuffered case (if I modify the example to use a Frame
instead a double-buffered JFrame I get stutter with all j2d pipelines).

The reason why I am not very happy with the current way is because:

1. It doesn't cover all cases, like non-doublebuffered frames.
2. It can lead to excessive sync'ing. Imagine an AWT based J2D based game
which renderes hundreds or even thousands of sprites directly to screen.
While this might be acceptable for OGL/D3D, it for sure is a no-go for
Xrender over network.
3. It is in my opinion at the wrong layer of abstraction, leading to
semantics/heuristics encoded into J2D which don't belong there. Actually
AWT knows when contents should be flushed to screen.  J2D currently flushes
after *every* Blit, regardless wether it is required or not.  Also, it
doesn't flush for other primitives like rects or lines making it's
behaviour inconsistent.


Best regards, Clemens

[Attachment #3 (text/html)]

<div dir="ltr"><div class="gmail_extra"><div style="font-size:12.8000001907349px">Hi \
Sergey,<br></div><div style="font-size:12.8000001907349px">  </div><blockquote \
class="gmail_quote" style="font-size:12.8000001907349px;margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Is \
there a reason why AWT doesn&#39;t explicitly flush and whythe flush-after-blit \
approach was chosen?<br></blockquote><span class="im">If a sync will be implemented \
in a Swing, then will be necessary to add a sync to all places where we paint an \
images to the screen, and this is equivalent of current solution, \
no?</span></blockquote><div style="font-size:12.8000001907349px"><br></div><div \
style="font-size:12.8000001907349px">Instead of thinking on the j2d level (blits), \
wouldn&#39;t it be enough to flush after handling of events that can possibly issue \
paint-operations to screen?  </div><div style="font-size:12.8000001907349px">This \
would also have the advantage to have contents flushed to screen even for the \
non-doublebuffered case (if I modify the example to use a Frame instead a \
double-buffered JFrame I get stutter with all j2d pipelines).</div><div \
style="font-size:12.8000001907349px"><br></div><div \
style="font-size:12.8000001907349px">The reason why I am not very happy with the \
current way is because:</div><div style="font-size:12.8000001907349px"><br></div><div \
style="font-size:12.8000001907349px">1. It doesn&#39;t cover all cases, like \
non-doublebuffered frames.</div><div style="font-size:12.8000001907349px">2. It can \
lead to excessive sync&#39;ing. Imagine  an AWT based J2D based game which renderes \
hundreds or even thousands of sprites directly to screen. While this might be \
acceptable for OGL/D3D, it for sure is a no-go for Xrender over \
network.<br></div><div style="font-size:12.8000001907349px">3. It is in my opinion at \
the wrong layer of abstraction, leading to semantics/heuristics encoded into J2D \
which don&#39;t belong there. Actually AWT knows when contents should be flushed to \
screen.   J2D currently flushes after *every* Blit, regardless wether it is required \
or not.   Also, it doesn&#39;t flush for other primitives like rects or lines making \
it&#39;s behaviour inconsistent.</div><div \
style="font-size:12.8000001907349px"><br></div><div \
style="font-size:12.8000001907349px"><br></div><div \
style="font-size:12.8000001907349px">Best regards, Clemens</div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic