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

List:       mono-patches
Subject:    [Mono-patches] r137146 - trunk/moon/src
From:       "Stephane Delcroix (stephane () delcroix ! org)"
Date:       2009-06-30 12:42:16
Message-ID: 20090630124216.A0B219472C () mono-cvs ! ximian ! com
[Download RAW message or body]

Author: stephane
Date: 2009-06-30 08:42:16 -0400 (Tue, 30 Jun 2009)
New Revision: 137146

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/multiscaleimage.cpp
   trunk/moon/src/multiscaleimage.h
Log:
2009-06-30  Stephane Delcroix  <sdelcroix@novell.com>

	* multiscaleimage.cpp: download the first num_dl (6) levels while the
	source is ready.

Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog	2009-06-30 12:18:20 UTC (rev 137145)
+++ trunk/moon/src/ChangeLog	2009-06-30 12:42:16 UTC (rev 137146)
@@ -1,3 +1,8 @@
+2009-06-30  Stephane Delcroix  <sdelcroix@novell.com>
+
+	* multiscaleimage.cpp: download the first num_dl (6) levels while the
+	source is ready.
+
 2009-06-29  Alan McGovern  <amcgovern@novell.com>
 
 	* control.cpp: Unregress drt 911, EnabledChanged events fire

Modified: trunk/moon/src/multiscaleimage.cpp
===================================================================
--- trunk/moon/src/multiscaleimage.cpp	2009-06-30 12:18:20 UTC (rev 137145)
+++ trunk/moon/src/multiscaleimage.cpp	2009-06-30 12:42:16 UTC (rev 137146)
@@ -384,6 +384,19 @@
 	}
 	msi->Invalidate ();
 
+	//try to get the first tiles
+	BitmapImageContext *bitmapimagectx;
+	int layer = 0;
+	//Get the first tiles
+	while ((bitmapimagectx = msi->GetFreeBitmapImageContext ())) {
+		Uri *tile = new Uri ();
+		if (source->get_tile_func (layer, 0, 0, tile, source))
+			msi->DownloadTile (bitmapimagectx, tile, -1, layer, 0, 0);
+		delete tile;
+		layer ++;
+	}
+
+
 	//FIXME: we're only emitting this in deepzoom case
 	msi->EmitImageOpenSucceeded ();
 }
@@ -888,6 +901,8 @@
 		cairo_surface_set_user_data (surface, &full_opacity_at_key, to, g_free);
 		LOG_MSI ("caching %s\n", ctx->bitmapimage->GetUriSource()->ToString ());
 		QTree *subimage_cache = (QTree*)g_hash_table_lookup (cache, &(ctx->subimage));
+		if (!subimage_cache)
+			g_hash_table_insert (cache, new int(ctx->subimage), (subimage_cache = qtree_new ()));
 		qtree_insert_with_value (subimage_cache, surface, ctx->level, ctx->x, ctx->y);
 
 		ctx->state = BitmapImageFree;

Modified: trunk/moon/src/multiscaleimage.h
===================================================================
--- trunk/moon/src/multiscaleimage.h	2009-06-30 12:18:20 UTC (rev 137145)
+++ trunk/moon/src/multiscaleimage.h	2009-06-30 12:42:16 UTC (rev 137146)
@@ -42,8 +42,6 @@
 	static void downloader_failed (EventObject *sender, EventArgs *calldata, gpointer closure);
 
 	GList *bitmapimages;
-	BitmapImageContext *GetFreeBitmapImageContext ();
-	void DownloadTile (BitmapImageContext *ctx, Uri *tile, int subimage, int level, int x, int y);
 	BitmapImageContext *GetBitmapImageContext (BitmapImage *bitmapimage);
 
 	void RenderSingle (cairo_t *cr, Region *region);
@@ -166,6 +164,9 @@
 	const static int ImageOpenSucceededEvent;
 	const static int MotionFinishedEvent;
 	const static int ViewportChangedEvent;
+
+	BitmapImageContext *GetFreeBitmapImageContext ();
+	void DownloadTile (BitmapImageContext *ctx, Uri *tile, int subimage, int level, int x, int y);
 };
 
 #endif /* __MULTISCALIMAGE_H__ */

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches
[prev in list] [next in list] [prev in thread] [next in thread] 

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