<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/118618/">https://git.reviewboard.kde.org/r/118618/</a>
     </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Marble, Friedrich W. H. Kossebau and Torsten Rahn.</div>
<div>By Dennis Nienhüser.</div>










<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
marble
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Data needed for rendering (texture tiles, search results, routes, ...) is often download from the Internet and Marble renders preliminary results while waiting for the data to arrive. The preliminary results are created in various ways, e.g. using old (outdated) data, higher level tiles or partial data. We inform the user to some extend about pending data (e.g. progress bar for tile downloads, busy indicator for routes), but there is no sane programmatical way at the moment to determine whether all data has arrived yet.

The patch adds an enum property RenderStatus { Complete, WaitingForUpdate, WaitingForData, Incomplete } to MarbleMap and MarbleWidget along with a renderStatusChanged() notification signal. LayerManager maintains that status value. Internally it delegates the status determination to all layers and uses a tree-like data structure to record all details. Here's a string-representation of that tree (with a couple of entries removed for readability):

Marble: Waiting for data
  Stars: Complete
  Atmosphere: Complete
  Anonymous renderer: Complete
  Textures: Waiting for data
    Stacked Tiles: Waiting for data
      Tile 13/4280/2403: Complete
        mapnik_data: Complete
        hillshading: Complete
      Tile 13/4280/2404: Complete
        mapnik_data: Complete
        hillshading: Complete
      Tile 13/4280/2405: Waiting for data
        mapnik_data: Waiting for data
        hillshading: Waiting for data
      Tile 13/4281/2402: Complete
        mapnik_data: Complete
        hillshading: Complete
     [...]
  Coordinate Grid: Complete
  GeoGraphicsScene: Complete
  [...]

To keep the patch size small for a first feedback round the status determination is not implemented yet for all layers that depend on http requests. Likewise I didn't change tools and examples yet to make use of it:
- maptheme-preview-image can wait for renderStatus to become Complete before taking the screenshot (no more hacks needed)
- examples/cpp/animation-video can wait for all tiles to arrive before rendering video frames (no more blurry tiles in videos)
- calligra can generate sane (preview) images

Besides finishing the implementation for various layers depending on network queries and making use of the status property in tools and examples, there are some nice possible follow-ups:
- merge the fps determiniation (runtimeTrace) into renderStatus. Fits well and is calculated at pretty much the same places
- add a Layers panel as a tool for developers (can be hidden by default and activated by a command line option), which uses a QTreeView to visualize layer order, runtime, and status similar to the string output above

Things you might want to comment on:
- Shall the enum RenderStatus be defined in MarbleGlobal.h? I went for that to keep further #includes out of MarbleWidget/MarbleMap
- Is the detail scope fine? MarbleWidget presents just a summary as an enum value, LayerManager has the full detail tree (see above), but does not expose it via 3rd-party API yet. I went for that as I don't think 3rd-party code is really interested in those details, but will just poll/wait for renderStatusChanged(Complete).
- Is merging runtimeTrace into renderStatus a good idea?

I'll treat no feedback as "go ahead" :-P
</pre>
  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/lib/marble/CMakeLists.txt <span style="color: grey">(395e8bf)</span></li>

 <li>src/lib/marble/LayerInterface.h <span style="color: grey">(d8d9ee9)</span></li>

 <li>src/lib/marble/LayerInterface.cpp <span style="color: grey">(c3629de)</span></li>

 <li>src/lib/marble/LayerManager.h <span style="color: grey">(fa609f3)</span></li>

 <li>src/lib/marble/LayerManager.cpp <span style="color: grey">(66eba7f)</span></li>

 <li>src/lib/marble/MarbleGlobal.h <span style="color: grey">(53d375c)</span></li>

 <li>src/lib/marble/MarbleMap.h <span style="color: grey">(e7ec453)</span></li>

 <li>src/lib/marble/MarbleMap.cpp <span style="color: grey">(0e1c70d)</span></li>

 <li>src/lib/marble/MarbleWidget.h <span style="color: grey">(e8148a9)</span></li>

 <li>src/lib/marble/MarbleWidget.cpp <span style="color: grey">(d58db8e)</span></li>

 <li>src/lib/marble/MergedLayerDecorator.h <span style="color: grey">(5b2be58)</span></li>

 <li>src/lib/marble/MergedLayerDecorator.cpp <span style="color: grey">(b187dc2)</span></li>

 <li>src/lib/marble/RenderPlugin.h <span style="color: grey">(11f2829)</span></li>

 <li>src/lib/marble/RenderPlugin.cpp <span style="color: grey">(87989f4)</span></li>

 <li>src/lib/marble/StackedTileLoader.h <span style="color: grey">(6fa8cd4)</span></li>

 <li>src/lib/marble/StackedTileLoader.cpp <span style="color: grey">(1dfe1a0)</span></li>

 <li>src/lib/marble/layers/FogLayer.h <span style="color: grey">(8d02bc7)</span></li>

 <li>src/lib/marble/layers/FogLayer.cpp <span style="color: grey">(24a1325)</span></li>

 <li>src/lib/marble/layers/GeometryLayer.h <span style="color: grey">(f868f26)</span></li>

 <li>src/lib/marble/layers/GeometryLayer.cpp <span style="color: grey">(daea513)</span></li>

 <li>src/lib/marble/layers/GroundLayer.h <span style="color: grey">(32568b3)</span></li>

 <li>src/lib/marble/layers/GroundLayer.cpp <span style="color: grey">(8c43076)</span></li>

 <li>src/lib/marble/layers/MarbleSplashLayer.h <span style="color: grey">(f0442ad)</span></li>

 <li>src/lib/marble/layers/MarbleSplashLayer.cpp <span style="color: grey">(e2647f3)</span></li>

 <li>src/lib/marble/layers/PlacemarkLayer.h <span style="color: grey">(7abc270)</span></li>

 <li>src/lib/marble/layers/PlacemarkLayer.cpp <span style="color: grey">(863fd94)</span></li>

 <li>src/lib/marble/layers/PopupLayer.h <span style="color: grey">(c470def)</span></li>

 <li>src/lib/marble/layers/PopupLayer.cpp <span style="color: grey">(11ba9b3)</span></li>

 <li>src/lib/marble/layers/TextureLayer.h <span style="color: grey">(28bfb65)</span></li>

 <li>src/lib/marble/layers/TextureLayer.cpp <span style="color: grey">(06fa006)</span></li>

 <li>src/lib/marble/routing/RoutingLayer.h <span style="color: grey">(86d4244)</span></li>

 <li>src/lib/marble/routing/RoutingLayer.cpp <span style="color: grey">(9840d7d)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/118618/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>