Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/8ad55e23fdf375278dfb381b9641596e0852a9d8
...commit
http://git.netsurf-browser.org/netsurf.git/commit/8ad55e23fdf375278dfb381b9641596e0852a9d8
...tree
http://git.netsurf-browser.org/netsurf.git/tree/8ad55e23fdf375278dfb381b9641596e0852a9d8
The branch, master has been updated
via 8ad55e23fdf375278dfb381b9641596e0852a9d8 (commit)
via 8e1154eb1cef4e102504fae25fb9805040d37226 (commit)
via db7f1f01a97cb9a26cbe6433542d7d6b25940929 (commit)
from dae0ff3d26d92af373d69f834573d114504c2fe6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=8ad55e23fdf375278dfb381b9641596e0852a9d8
commit 8ad55e23fdf375278dfb381b9641596e0852a9d8
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
gif: Change how we rate-limit frames to match other browsers.
This makes the old minimum_gif_delay option unused.
diff --git a/content/handlers/image/gif.c b/content/handlers/image/gif.c
index fa343fb..fa09f40 100644
--- a/content/handlers/image/gif.c
+++ b/content/handlers/image/gif.c
@@ -154,8 +154,10 @@ static void nsgif_animate(void *p)
/* Continue animating if we should */
if (gif->gif->loop_count >= 0) {
delay = gif->gif->frames[gif->current_frame].frame_delay;
- if (delay < nsoption_int(minimum_gif_delay))
- delay = nsoption_int(minimum_gif_delay);
+ if (delay <= 1) {
+ /* Assuming too fast to be intended, set default. */
+ delay = 10;
+ }
guit->misc->schedule(delay * 10, nsgif_animate, gif);
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=8e1154eb1cef4e102504fae25fb9805040d37226
commit 8e1154eb1cef4e102504fae25fb9805040d37226
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Content: Remove redundant and unused redraw message fields.
This was archaic support for rendering images as "overlays",
and avoiding a redraw via the browser window redraw and HTML
contents. Basically it was "plot this image here", but it
was too error prone, so it was removed a long time ago.
These are some last vestiges that made the redraw message
look more complex than it is.
diff --git a/content/content.c b/content/content.c
index 385847d..82a87c5 100644
--- a/content/content.c
+++ b/content/content.c
@@ -538,14 +538,6 @@ void content__request_redraw(struct content *c,
data.redraw.width = width;
data.redraw.height = height;
- data.redraw.full_redraw = true;
-
- data.redraw.object = c;
- data.redraw.object_x = 0;
- data.redraw.object_y = 0;
- data.redraw.object_width = c->width;
- data.redraw.object_height = c->height;
-
content_broadcast(c, CONTENT_MSG_REDRAW, &data);
}
diff --git a/content/content.h b/content/content.h
index a5bf46c..f3e578b 100644
--- a/content/content.h
+++ b/content/content.h
@@ -131,15 +131,6 @@ union content_msg_data {
/** CONTENT_MSG_REDRAW - Area of content which needs redrawing */
struct {
int x, y, width, height;
- /** Redraw the area fully. If false, object must be set,
- * and only the object will be redrawn. */
- bool full_redraw;
- /** Object to redraw if full_redraw is false. */
- struct content *object;
- /** Coordinates to plot object at. */
- int object_x, object_y;
- /** Dimensions to plot object with. */
- int object_width, object_height;
} redraw;
/** CONTENT_MSG_REFRESH - Minimum delay */
int delay;
diff --git a/content/handlers/html/html_object.c
b/content/handlers/html/html_object.c
index 37bf29f..223f551 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -191,7 +191,6 @@ html_object_callback(hlcache_handle *object,
data.redraw.y = y + box->padding[TOP];
data.redraw.width = box->width;
data.redraw.height = box->height;
- data.redraw.full_redraw = true;
content_broadcast(&c->base, CONTENT_MSG_REDRAW, &data);
}
@@ -289,53 +288,39 @@ html_object_callback(hlcache_handle *object,
break;
}
- data.redraw.object_width = box->width;
- data.redraw.object_height = box->height;
-
/* Add offset to box */
data.redraw.x += x;
data.redraw.y += y;
- data.redraw.object_x += x;
- data.redraw.object_y += y;
-
- content_broadcast(&c->base,
- CONTENT_MSG_REDRAW, &data);
- break;
} else {
/* Non-background case */
- if (hlcache_handle_get_content(object) ==
- event->data.redraw.object) {
-
- int w = content_get_width(object);
- int h = content_get_height(object);
-
- if (w != 0) {
- data.redraw.x =
- data.redraw.x *
+ int w = content_get_width(object);
+ int h = content_get_height(object);
+
+ if (w != 0 && box->width != w) {
+ /* Not showing image at intrinsic
+ * width; need to scale the redraw
+ * request area. */
+ data.redraw.x = data.redraw.x *
box->width / w;
- data.redraw.width =
+ data.redraw.width =
data.redraw.width *
box->width / w;
- }
+ }
- if (h != 0) {
- data.redraw.y =
- data.redraw.y *
+ if (h != 0 && box->height != w) {
+ /* Not showing image at intrinsic
+ * height; need to scale the redraw
+ * request area. */
+ data.redraw.y = data.redraw.y *
box->height / h;
- data.redraw.height =
+ data.redraw.height =
data.redraw.height *
box->height / h;
- }
-
- data.redraw.object_width = box->width;
- data.redraw.object_height = box->height;
}
data.redraw.x += x + box->padding[LEFT];
data.redraw.y += y + box->padding[TOP];
- data.redraw.object_x += x + box->padding[LEFT];
- data.redraw.object_y += y + box->padding[TOP];
}
content_broadcast(&c->base, CONTENT_MSG_REDRAW, &data);
diff --git a/content/handlers/image/gif.c b/content/handlers/image/gif.c
index 94f8d3f..fa343fb 100644
--- a/content/handlers/image/gif.c
+++ b/content/handlers/image/gif.c
@@ -173,11 +173,9 @@ static void nsgif_animate(void *p)
/* redraw background (true) or plot on top (false) */
if (gif->current_frame > 0) {
- data.redraw.full_redraw =
- gif->gif->frames[f - 1].redraw_required;
/* previous frame needed clearing: expand the redraw area to
* cover it */
- if (data.redraw.full_redraw) {
+ if (gif->gif->frames[f - 1].redraw_required) {
if (data.redraw.x >
(int)(gif->gif->frames[f -
1].redraw_x)) {
data.redraw.width += data.redraw.x -
@@ -207,28 +205,8 @@ static void nsgif_animate(void *p)
data.redraw.y +
gif->gif->frames[f - 1].redraw_height;
}
- } else {
- /* do advanced check */
- if ((data.redraw.x == 0) && (data.redraw.y == 0) &&
- (data.redraw.width == (int)(gif->gif->width)) &&
- (data.redraw.height ==
(int)(gif->gif->height))) {
- data.redraw.full_redraw = !gif->gif->frames[f].opaque;
- } else {
- data.redraw.full_redraw = true;
- data.redraw.x = 0;
- data.redraw.y = 0;
- data.redraw.width = gif->gif->width;
- data.redraw.height = gif->gif->height;
- }
}
- /* other data */
- data.redraw.object = (struct content *) gif;
- data.redraw.object_x = 0;
- data.redraw.object_y = 0;
- data.redraw.object_width = gif->base.width;
- data.redraw.object_height = gif->base.height;
-
content_broadcast(&gif->base, CONTENT_MSG_REDRAW, &data);
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=db7f1f01a97cb9a26cbe6433542d7d6b25940929
commit db7f1f01a97cb9a26cbe6433542d7d6b25940929
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Data fetcher: Squash BSD warning.
diff --git a/content/fetchers/data.c b/content/fetchers/data.c
index fdcfe64..d41c4e8 100644
--- a/content/fetchers/data.c
+++ b/content/fetchers/data.c
@@ -86,10 +86,7 @@ static void fetch_data_send_header(struct fetch_data_context
*ctx,
const char *fmt, ...)
{
char header[64];
- fetch_msg msg = {
- .type = FETCH_HEADER,
- .data.header_or_data.buf = (const uint8_t *) header,
- };
+ fetch_msg msg;
va_list ap;
int len;
@@ -101,7 +98,9 @@ static void fetch_data_send_header(struct fetch_data_context
*ctx,
return;
}
+ msg.type = FETCH_HEADER;
msg.data.header_or_data.len = len;
+ msg.data.header_or_data.buf = (const uint8_t *)header;
fetch_data_send_callback(&msg, ctx);
}
-----------------------------------------------------------------------
Summary of changes:
content/content.c | 8 ------
content/content.h | 9 -------
content/fetchers/data.c | 7 +++---
content/handlers/html/html_object.c | 47 ++++++++++++-----------------------
content/handlers/image/gif.c | 30 ++++------------------
5 files changed, 24 insertions(+), 77 deletions(-)
diff --git a/content/content.c b/content/content.c
index 385847d..82a87c5 100644
--- a/content/content.c
+++ b/content/content.c
@@ -538,14 +538,6 @@ void content__request_redraw(struct content *c,
data.redraw.width = width;
data.redraw.height = height;
- data.redraw.full_redraw = true;
-
- data.redraw.object = c;
- data.redraw.object_x = 0;
- data.redraw.object_y = 0;
- data.redraw.object_width = c->width;
- data.redraw.object_height = c->height;
-
content_broadcast(c, CONTENT_MSG_REDRAW, &data);
}
diff --git a/content/content.h b/content/content.h
index a5bf46c..f3e578b 100644
--- a/content/content.h
+++ b/content/content.h
@@ -131,15 +131,6 @@ union content_msg_data {
/** CONTENT_MSG_REDRAW - Area of content which needs redrawing */
struct {
int x, y, width, height;
- /** Redraw the area fully. If false, object must be set,
- * and only the object will be redrawn. */
- bool full_redraw;
- /** Object to redraw if full_redraw is false. */
- struct content *object;
- /** Coordinates to plot object at. */
- int object_x, object_y;
- /** Dimensions to plot object with. */
- int object_width, object_height;
} redraw;
/** CONTENT_MSG_REFRESH - Minimum delay */
int delay;
diff --git a/content/fetchers/data.c b/content/fetchers/data.c
index fdcfe64..d41c4e8 100644
--- a/content/fetchers/data.c
+++ b/content/fetchers/data.c
@@ -86,10 +86,7 @@ static void fetch_data_send_header(struct fetch_data_context
*ctx,
const char *fmt, ...)
{
char header[64];
- fetch_msg msg = {
- .type = FETCH_HEADER,
- .data.header_or_data.buf = (const uint8_t *) header,
- };
+ fetch_msg msg;
va_list ap;
int len;
@@ -101,7 +98,9 @@ static void fetch_data_send_header(struct fetch_data_context
*ctx,
return;
}
+ msg.type = FETCH_HEADER;
msg.data.header_or_data.len = len;
+ msg.data.header_or_data.buf = (const uint8_t *)header;
fetch_data_send_callback(&msg, ctx);
}
diff --git a/content/handlers/html/html_object.c
b/content/handlers/html/html_object.c
index 37bf29f..223f551 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -191,7 +191,6 @@ html_object_callback(hlcache_handle *object,
data.redraw.y = y + box->padding[TOP];
data.redraw.width = box->width;
data.redraw.height = box->height;
- data.redraw.full_redraw = true;
content_broadcast(&c->base, CONTENT_MSG_REDRAW, &data);
}
@@ -289,53 +288,39 @@ html_object_callback(hlcache_handle *object,
break;
}
- data.redraw.object_width = box->width;
- data.redraw.object_height = box->height;
-
/* Add offset to box */
data.redraw.x += x;
data.redraw.y += y;
- data.redraw.object_x += x;
- data.redraw.object_y += y;
-
- content_broadcast(&c->base,
- CONTENT_MSG_REDRAW, &data);
- break;
} else {
/* Non-background case */
- if (hlcache_handle_get_content(object) ==
- event->data.redraw.object) {
-
- int w = content_get_width(object);
- int h = content_get_height(object);
-
- if (w != 0) {
- data.redraw.x =
- data.redraw.x *
+ int w = content_get_width(object);
+ int h = content_get_height(object);
+
+ if (w != 0 && box->width != w) {
+ /* Not showing image at intrinsic
+ * width; need to scale the redraw
+ * request area. */
+ data.redraw.x = data.redraw.x *
box->width / w;
- data.redraw.width =
+ data.redraw.width =
data.redraw.width *
box->width / w;
- }
+ }
- if (h != 0) {
- data.redraw.y =
- data.redraw.y *
+ if (h != 0 && box->height != w) {
+ /* Not showing image at intrinsic
+ * height; need to scale the redraw
+ * request area. */
+ data.redraw.y = data.redraw.y *
box->height / h;
- data.redraw.height =
+ data.redraw.height =
data.redraw.height *
box->height / h;
- }
-
- data.redraw.object_width = box->width;
- data.redraw.object_height = box->height;
}
data.redraw.x += x + box->padding[LEFT];
data.redraw.y += y + box->padding[TOP];
- data.redraw.object_x += x + box->padding[LEFT];
- data.redraw.object_y += y + box->padding[TOP];
}
content_broadcast(&c->base, CONTENT_MSG_REDRAW, &data);
diff --git a/content/handlers/image/gif.c b/content/handlers/image/gif.c
index 94f8d3f..fa09f40 100644
--- a/content/handlers/image/gif.c
+++ b/content/handlers/image/gif.c
@@ -154,8 +154,10 @@ static void nsgif_animate(void *p)
/* Continue animating if we should */
if (gif->gif->loop_count >= 0) {
delay = gif->gif->frames[gif->current_frame].frame_delay;
- if (delay < nsoption_int(minimum_gif_delay))
- delay = nsoption_int(minimum_gif_delay);
+ if (delay <= 1) {
+ /* Assuming too fast to be intended, set default. */
+ delay = 10;
+ }
guit->misc->schedule(delay * 10, nsgif_animate, gif);
}
@@ -173,11 +175,9 @@ static void nsgif_animate(void *p)
/* redraw background (true) or plot on top (false) */
if (gif->current_frame > 0) {
- data.redraw.full_redraw =
- gif->gif->frames[f - 1].redraw_required;
/* previous frame needed clearing: expand the redraw area to
* cover it */
- if (data.redraw.full_redraw) {
+ if (gif->gif->frames[f - 1].redraw_required) {
if (data.redraw.x >
(int)(gif->gif->frames[f -
1].redraw_x)) {
data.redraw.width += data.redraw.x -
@@ -207,28 +207,8 @@ static void nsgif_animate(void *p)
data.redraw.y +
gif->gif->frames[f - 1].redraw_height;
}
- } else {
- /* do advanced check */
- if ((data.redraw.x == 0) && (data.redraw.y == 0) &&
- (data.redraw.width == (int)(gif->gif->width)) &&
- (data.redraw.height ==
(int)(gif->gif->height))) {
- data.redraw.full_redraw = !gif->gif->frames[f].opaque;
- } else {
- data.redraw.full_redraw = true;
- data.redraw.x = 0;
- data.redraw.y = 0;
- data.redraw.width = gif->gif->width;
- data.redraw.height = gif->gif->height;
- }
}
- /* other data */
- data.redraw.object = (struct content *) gif;
- data.redraw.object_x = 0;
- data.redraw.object_y = 0;
- data.redraw.object_width = gif->base.width;
- data.redraw.object_height = gif->base.height;
-
content_broadcast(&gif->base, CONTENT_MSG_REDRAW, &data);
}
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org