Changeset 93683 in webkit
- Timestamp:
- Aug 23, 2011 6:39:30 PM (13 years ago)
- Location:
- trunk/Source/WebKit/efl
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/efl/ChangeLog
r93637 r93683 1 2011-08-23 KwangHyuk Kim <hyuki.kim@samsung.com> 2 3 [EFL] Change the tiled backing store to use constant size of tile. 4 https://bugs.webkit.org/show_bug.cgi?id=65848 5 6 As current tiled backing store in Webkit EFL is using variable tile size according to the zoom level, 7 the number of tiles in viewport is not same always and the speed of panning is also not consistent 8 whenever zoom level is changed. 9 Therefore, tile size should be constant size in order to make sure the consistent panning speed. 10 11 Reviewed by Anders Carlsson. 12 13 * ewk/ewk_tiled_backing_store.c: 14 (_ewk_tiled_backing_store_model_matrix_create): 15 (_ewk_tiled_backing_store_smart_add): 16 (_ewk_tiled_backing_store_smart_calculate): 17 (_ewk_tiled_backing_store_zoom_set_internal): 18 (ewk_tiled_backing_store_zoom_weak_set): 19 (ewk_tiled_backing_store_flush): 20 (ewk_tiled_backing_store_pre_render_region): 21 (ewk_tiled_backing_store_pre_render_relative_radius): 22 * ewk/ewk_tiled_backing_store.h: 23 * ewk/ewk_tiled_matrix.c: 24 (_ewk_tile_matrix_cell_free): 25 (_ewk_tile_matrix_tile_free): 26 (ewk_tile_matrix_new): 27 (ewk_tile_matrix_tile_exact_get): 28 (ewk_tile_matrix_tile_exact_exists): 29 (ewk_tile_matrix_tile_new): 30 (ewk_tile_matrix_tile_update): 31 (ewk_tile_matrix_tile_update_full): 32 (_ewk_tile_matrix_slicer_setup): 33 (ewk_tile_matrix_update): 34 (ewk_tile_matrix_dbg): 35 * ewk/ewk_tiled_matrix.h: 36 * ewk/ewk_tiled_model.c: 37 (ewk_tile_new): 38 1 39 2011-08-23 Jonas M. Gastal <jgastal@profusion.mobi> 2 40 -
trunk/Source/WebKit/efl/ewk/ewk_tiled_backing_store.c
r93409 r93683 634 634 } 635 635 636 priv->model.matrix = ewk_tile_matrix_new 637 (tuc, priv->model.cur.cols, priv->model.cur.rows, priv->cspace, 638 _ewk_tiled_backing_store_render, priv); 636 priv->model.matrix = ewk_tile_matrix_new(tuc, priv->model.cur.cols, priv->model.cur.rows, priv->cspace, _ewk_tiled_backing_store_render, priv); 639 637 } 640 638 … … 704 702 priv->self = o; 705 703 priv->view.tile.zoom = 1.0; 706 priv->view.tile.w = TILE_W;707 priv->view.tile.h = TILE_H;704 priv->view.tile.w = DEFAULT_TILE_W; 705 priv->view.tile.h = DEFAULT_TILE_H; 708 706 priv->view.offset.cur.x = 0; 709 707 priv->view.offset.cur.y = 0; … … 1352 1350 priv->model.cur.rows); 1353 1351 priv->changed.model = EINA_FALSE; 1354 evas_object_resize(priv->contents_clipper, 1355 priv->model.width, priv->model.height); 1352 evas_object_resize(priv->contents_clipper, priv->model.width, priv->model.height); 1356 1353 _ewk_tiled_backing_store_smart_calculate_offset_force(priv); 1357 1354 … … 1482 1479 _ewk_tiled_backing_store_pre_render_request_flush(priv); 1483 1480 Evas_Coord tw, th; 1484 tw = TILE_SIZE_AT_ZOOM(TILE_W, *zoom); 1485 tw = (tw >> 1) << 1;1486 *zoom = TILE_W_ZOOM_AT_SIZE(tw); 1487 /* WARNING: assume reverse zoom is the same for both axis */1488 th = TILE_SIZE_AT_ZOOM(TILE_H, *zoom);1481 1482 *zoom = ROUNDED_ZOOM(priv->view.tile.w, *zoom); 1483 1484 tw = priv->view.tile.w; 1485 th = priv->view.tile.h; 1489 1486 1490 1487 float scale = *zoom / priv->view.tile.zoom; … … 1495 1492 priv->view.offset.zoom_center.y = cy; 1496 1493 1497 priv->view.tile.w = tw;1498 priv->view.tile.h = th;1499 1494 1500 1495 if (!priv->view.w || !priv->view.h) { … … 1530 1525 1531 1526 priv->changed.size = EINA_TRUE; 1527 priv->changed.model = EINA_TRUE; 1532 1528 _ewk_tiled_backing_store_changed(priv); 1533 1529 … … 1590 1586 Eina_Bool recalc = EINA_FALSE; 1591 1587 1592 tw = TILE_SIZE_AT_ZOOM(TILE_W, zoom);1593 zoom = TILE_W_ZOOM_AT_SIZE(tw);1594 /* WARNING: assume reverse zoom is the same for both axis */1595 th = TILE_SIZE_AT_ZOOM(TILE_H, zoom);1596 1597 1588 float scale = zoom / priv->view.tile.zoom; 1589 1590 tw = TILE_SIZE_AT_ZOOM(priv->view.tile.w, scale); 1591 scale = TILE_ZOOM_AT_SIZE(tw, priv->view.tile.w); 1592 th = TILE_SIZE_AT_ZOOM(priv->view.tile.h, scale); 1593 zoom = scale * priv->view.tile.zoom; 1598 1594 1599 1595 Evas_Coord model_width = priv->model.width * scale; 1600 1596 Evas_Coord model_height = priv->model.height * scale; 1601 1597 1602 evas_object_resize(priv->contents_clipper, 1603 model_width, model_height); 1598 evas_object_resize(priv->contents_clipper, model_width, model_height); 1604 1599 1605 1600 int vrows = ceil((float)priv->view.h / (float)th) + 1; … … 1809 1804 priv->model.base.col = 0; 1810 1805 priv->model.base.row = 0; 1806 priv->model.cur.cols = 1; 1807 priv->model.cur.rows = 1; 1808 priv->model.old.cols = 0; 1809 priv->model.old.rows = 0; 1811 1810 priv->changed.size = EINA_TRUE; 1812 1811 … … 1835 1834 Ewk_Tile_Unused_Cache *tuc; 1836 1835 1837 tw = TILE_SIZE_AT_ZOOM(TILE_W, zoom); 1838 tw = (tw >> 1) << 1; 1839 zoom = TILE_W_ZOOM_AT_SIZE(tw); 1840 /* WARNING: assume reverse zoom is the same for both axis */ 1841 th = TILE_SIZE_AT_ZOOM(TILE_H, zoom); 1836 tw = priv->view.tile.w; 1837 th = priv->view.tile.h; 1838 zoom = ROUNDED_ZOOM(priv->view.tile.w, zoom); 1842 1839 1843 1840 if (!eina_tile_grid_slicer_setup(&slicer, x, y, w, h, tw, th)) { … … 1879 1876 start_row, end_row, start_col, end_col); 1880 1877 1878 zoom = ROUNDED_ZOOM(priv->view.tile.w, zoom); 1879 1881 1880 for (i = start_row; i <= end_row; i++) 1882 1881 for (j = start_col; j <= end_col; j++) … … 1888 1887 1889 1888 tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix); 1890 h = (end_row - start_row + 1) * TILE_SIZE_AT_ZOOM( TILE_H, zoom);1891 w = (end_col - start_col + 1) * TILE_SIZE_AT_ZOOM( TILE_W, zoom);1889 h = (end_row - start_row + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.h, zoom); 1890 w = (end_col - start_col + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.w, zoom); 1892 1891 ewk_tile_unused_cache_lock_area(tuc, 1893 start_col * TILE_SIZE_AT_ZOOM( TILE_W, zoom),1894 start_row * TILE_SIZE_AT_ZOOM( TILE_H, zoom), w, h, zoom);1892 start_col * TILE_SIZE_AT_ZOOM(priv->view.tile.w, zoom), 1893 start_row * TILE_SIZE_AT_ZOOM(priv->view.tile.h, zoom), w, h, zoom); 1895 1894 1896 1895 return EINA_TRUE; -
trunk/Source/WebKit/efl/ewk/ewk_tiled_backing_store.h
r91974 r93683 34 34 #undef DEBUG_MEM_LEAKS 35 35 36 #define TILE_W (256)37 #define TILE_H (256)36 #define DEFAULT_TILE_W (256) 37 #define DEFAULT_TILE_H (256) 38 38 39 39 #define ZOOM_STEP_MIN (0.01) 40 40 41 41 #define TILE_SIZE_AT_ZOOM(SIZE, ZOOM) ((int)roundf((SIZE) * (ZOOM))) 42 #define TILE_ W_ZOOM_AT_SIZE(SIZE) ((float)SIZE / (float)TILE_W)43 #define TILE_H_ZOOM_AT_SIZE(SIZE) ((float)SIZE / (float)TILE_H)42 #define TILE_ZOOM_AT_SIZE(SIZE, ORIG_TILE) ((float)(SIZE) / (float)(ORIG_TILE)) 43 #define ROUNDED_ZOOM(SIZE, ZOOM) ((float)(SIZE) / (float)(((int)roundf((SIZE) / (ZOOM))))) 44 44 45 45 #ifdef __cplusplus … … 67 67 68 68 struct _Ewk_Tile { 69 EINA_INLIST; /**< sibling tiles at same (i, j) but other zoom */70 69 Eina_Tiler *updates; /**< updated/dirty areas */ 71 70 Ewk_Tile_Stats stats; /**< tile usage statistics */ -
trunk/Source/WebKit/efl/ewk/ewk_tiled_matrix.c
r74554 r93683 33 33 #include <string.h> 34 34 35 static const Evas_Coord TILE_MATRIX_BASE_TILE_SIZE = 256;36 37 35 struct _Ewk_Tile_Matrix { 38 36 Eina_Matrixsparse *matrix; … … 45 43 unsigned int frozen; 46 44 Eina_List *updates; 45 struct { 46 Evas_Coord w, h; 47 } tile; 47 48 #ifdef DEBUG_MEM_LEAKS 48 49 struct { … … 63 64 { 64 65 Ewk_Tile_Matrix *tm = user_data; 65 E ina_Inlist *l= cell_data;66 67 if (! l)66 Ewk_Tile *t = cell_data; 67 68 if (!t) 68 69 return; 69 70 70 71 ewk_tile_unused_cache_freeze(tm->tuc); 71 72 72 while (l) { 73 Ewk_Tile *t = (Ewk_Tile *)l; 74 l = l->next; 75 76 if (t->updates || t->stats.full_update) 77 tm->updates = eina_list_remove(tm->updates, t); 78 79 if (t->visible) 80 ERR("freeing cell that is visible, leaking tile %p", t); 73 if (t->updates || t->stats.full_update) 74 tm->updates = eina_list_remove(tm->updates, t); 75 76 if (t->visible) 77 ERR("freeing cell that is visible, leaking tile %p", t); 78 else { 79 if (!ewk_tile_unused_cache_tile_get(tm->tuc, t)) 80 ERR("tile %p was not in cache %p? leaking...", t, tm->tuc); 81 81 else { 82 if (!ewk_tile_unused_cache_tile_get(tm->tuc, t)) 83 ERR("tile %p was not in cache %p? leaking...", t, tm->tuc); 84 else { 85 DBG("tile cell does not exist anymore, free it %p", t); 86 87 #ifdef DEBUG_MEM_LEAKS 88 tm->stats.bytes.freed += t->bytes; 89 tm->stats.tiles.freed++; 90 #endif 91 92 ewk_tile_free(t); 93 } 82 DBG("tile cell does not exist anymore, free it %p", t); 83 #ifdef DEBUG_MEM_LEAKS 84 tm->stats.bytes.freed += t->bytes; 85 tm->stats.tiles.freed++; 86 #endif 87 ewk_tile_free(t); 94 88 } 95 89 } … … 103 97 Ewk_Tile_Matrix *tm = data; 104 98 Eina_Matrixsparse_Cell *cell; 105 Eina_Inlist *l, *old; 106 99 107 100 if (!eina_matrixsparse_cell_idx_get(tm->matrix, t->row, t->col, &cell)) { 108 101 ERR("removing tile %p that was not in the matrix? Leaking...", t); … … 110 103 } 111 104 105 if (!cell) { 106 ERR("removing tile %p that was not in the matrix? Leaking...", t); 107 return; 108 } 109 112 110 if (t->updates || t->stats.full_update) 113 111 tm->updates = eina_list_remove(tm->updates, t); 114 112 115 old = eina_matrixsparse_cell_data_get(cell); 116 l = eina_inlist_remove(old, EINA_INLIST_GET(t)); 117 if (!l) { 118 /* set to null to avoid double free */ 119 eina_matrixsparse_cell_data_replace(cell, NULL, NULL); 120 eina_matrixsparse_cell_clear(cell); 121 } else if (old != l) 122 eina_matrixsparse_cell_data_replace(cell, l, NULL); 113 /* set to null to avoid double free */ 114 eina_matrixsparse_cell_data_replace(cell, NULL, NULL); 115 eina_matrixsparse_cell_clear(cell); 123 116 124 117 if (EINA_UNLIKELY(!!t->visible)) { … … 150 143 * @param cspace the color space used to create tiles in this matrix. 151 144 * @param render_cb function used to render given tile update. 152 * @param data context to give back to @a render_cb.145 * @param render_data context to give back to @a render_cb. 153 146 * 154 147 * @return newly allocated instance on success, @c NULL on failure. 155 148 */ 156 Ewk_Tile_Matrix *ewk_tile_matrix_new(Ewk_Tile_Unused_Cache *tuc, unsigned long cols, unsigned long rows, Evas_Colorspace cspace, void (*render_cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void * data)149 Ewk_Tile_Matrix *ewk_tile_matrix_new(Ewk_Tile_Unused_Cache *tuc, unsigned long cols, unsigned long rows, Evas_Colorspace cspace, void (*render_cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void *render_data) 157 150 { 158 151 Ewk_Tile_Matrix *tm; … … 181 174 tm->cspace = cspace; 182 175 tm->render.cb = render_cb; 183 tm->render.data = (void *)data; 176 tm->render.data = (void *)render_data; 177 tm->tile.w = DEFAULT_TILE_W; 178 tm->tile.h = DEFAULT_TILE_H; 184 179 185 180 return tm; … … 273 268 * ewk_tile_matrix_tile_put() afterwards. 274 269 * 275 * @see ewk_tile_matrix_tile_nearest_get()276 270 * @see ewk_tile_matrix_tile_exact_get() 277 271 */ 278 272 Ewk_Tile *ewk_tile_matrix_tile_exact_get(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row, float zoom) 279 273 { 280 Ewk_Tile *t, *item, *item_found = NULL; 281 Eina_Inlist *inl; 282 274 Ewk_Tile *t; 283 275 t = eina_matrixsparse_data_idx_get(tm->matrix, row, col); 284 276 if (!t) … … 287 279 if (t->zoom == zoom) 288 280 goto end; 289 290 EINA_INLIST_FOREACH(EINA_INLIST_GET(t), item) {291 if (item->zoom != zoom)292 continue;293 item_found = item;294 break;295 }296 297 if (!item_found)298 return NULL;299 300 inl = eina_inlist_promote(EINA_INLIST_GET(t), EINA_INLIST_GET(item_found));301 eina_matrixsparse_data_idx_replace(tm->matrix, row, col, inl, NULL);302 281 303 282 end: … … 324 303 Eina_Bool ewk_tile_matrix_tile_exact_exists(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row, float zoom) 325 304 { 326 Ewk_Tile *t , *item;305 Ewk_Tile *t; 327 306 328 307 t = eina_matrixsparse_data_idx_get(tm->matrix, row, col); … … 330 309 return EINA_FALSE; 331 310 332 EINA_INLIST_FOREACH(EINA_INLIST_GET(t), item) { 333 if (item->zoom == zoom) 334 return EINA_TRUE; 335 } 336 337 return EINA_FALSE; 338 } 339 340 /** 341 * Get the nearest tile for given position and zoom. 342 * 343 * The nearest tile is the one at the given position but with the 344 * closest zoom, this being the division of the tile zoom by the 345 * desired zoom, the closest to 1.0 gets it. 346 * 347 * If the tile was unused then it's removed from the cache. 348 * 349 * After usage, please give it back using ewk_tile_matrix_tile_put(). 350 * 351 * @param tm the tile matrix to get tile from. 352 * @param col the column number. 353 * @param row the row number. 354 * @param zoom the exact zoom to use. 355 * 356 * @return The tile instance or @c NULL if none is found. If the tile 357 * was in the unused cache it will be @b removed (thus 358 * considered used) and one should give it back with 359 * ewk_tile_matrix_tile_put() afterwards. 360 */ 361 Ewk_Tile *ewk_tile_matrix_tile_nearest_get(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row, float zoom) 362 { 363 Ewk_Tile *t, *item, *item_found = NULL; 364 Eina_Inlist *inl; 365 float zoom_found = 0; 366 367 EINA_SAFETY_ON_NULL_RETURN_VAL(tm, NULL); 368 EINA_SAFETY_ON_FALSE_RETURN_VAL(zoom > 0.0, NULL); 369 370 t = eina_matrixsparse_data_idx_get(tm->matrix, row, col); 371 if (!t) 372 return NULL; 373 374 if (t->zoom == zoom) { 375 item_found = t; 376 goto end; 377 } 378 379 EINA_INLIST_FOREACH(EINA_INLIST_GET(t), item) { 380 float cur_zoom = item->zoom; 381 382 if (cur_zoom == zoom) { 383 item_found = item; 384 break; 385 } 386 387 if (cur_zoom > zoom) 388 cur_zoom = zoom / cur_zoom; 389 else 390 cur_zoom = cur_zoom / zoom; 391 392 if (cur_zoom > zoom_found) { 393 item_found = item; 394 zoom_found = cur_zoom; 395 } 396 } 397 398 if (!item_found) 399 return NULL; 400 401 inl = eina_inlist_promote(EINA_INLIST_GET(t), EINA_INLIST_GET(item_found)); 402 eina_matrixsparse_data_idx_replace(tm->matrix, row, col, inl, NULL); 403 404 end: 405 if (!item_found->visible) { 406 if (!ewk_tile_unused_cache_tile_get(tm->tuc, item_found)) 407 WRN("Ewk_Tile was unused but not in cache? bug!"); 408 } 409 410 return item_found; 311 return EINA_TRUE; 411 312 } 412 313 … … 425 326 Ewk_Tile *ewk_tile_matrix_tile_new(Ewk_Tile_Matrix *tm, Evas *evas, unsigned long col, unsigned int row, float zoom) 426 327 { 427 Evas_Coord s; 428 Eina_Inlist *old; 328 Evas_Coord tw, th; 429 329 Ewk_Tile *t; 430 330 … … 432 332 EINA_SAFETY_ON_FALSE_RETURN_VAL(zoom > 0.0, NULL); 433 333 434 s = TILE_SIZE_AT_ZOOM(TILE_MATRIX_BASE_TILE_SIZE, zoom);435 zoom = (float)s / (float)TILE_MATRIX_BASE_TILE_SIZE;436 437 t = ewk_tile_new(evas, s, s, zoom, tm->cspace);334 tw = tm->tile.w; 335 th = tm->tile.h; 336 337 t = ewk_tile_new(evas, tw, th, zoom, tm->cspace); 438 338 if (!t) { 439 ERR("could not create tile %dx%d at %f, cspace=%d", 440 s, s, (double)zoom, tm->cspace); 339 ERR("could not create tile %dx%d at %f, cspace=%d", tw, th, (double)zoom, tm->cspace); 441 340 return NULL; 442 341 } 443 342 444 old = eina_matrixsparse_data_idx_get(tm->matrix, row, col); 445 old = eina_inlist_prepend(old, EINA_INLIST_GET(t)); 446 if (!eina_matrixsparse_data_idx_replace(tm->matrix, row, col, t, NULL)) { 343 if (!eina_matrixsparse_data_idx_set(tm->matrix, row, col, t)) { 447 344 ERR("could not set matrix cell, row/col outside matrix dimensions!"); 448 345 ewk_tile_free(t); … … 452 349 t->col = col; 453 350 t->row = row; 454 t->x = col * s;455 t->y = row * s;351 t->x = col * tw; 352 t->y = row * th; 456 353 457 354 cairo_translate(t->cairo, -t->x, -t->y); … … 472 369 * 473 370 * This will report the tile is no longer in use by the one that got 474 * it with ewk_tile_matrix_tile_nearest_get() or 475 * ewk_tile_matrix_tile_exact_get(). 371 * it with ewk_tile_matrix_tile_exact_get(). 476 372 * 477 373 * Any previous reference to tile should be released … … 500 396 Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row, const Eina_Rectangle *update) 501 397 { 502 Ewk_Tile * l, *t;398 Ewk_Tile *t; 503 399 Eina_Rectangle new_update; 504 400 EINA_SAFETY_ON_NULL_RETURN_VAL(tm, EINA_FALSE); … … 512 408 } 513 409 514 if (update->x + update->w - 1 >= TILE_MATRIX_BASE_TILE_SIZE)515 new_update.w = TILE_MATRIX_BASE_TILE_SIZE- update->x;516 if (update->y + update->h - 1 >= TILE_MATRIX_BASE_TILE_SIZE)517 new_update.h = TILE_MATRIX_BASE_TILE_SIZE- update->y;518 519 l= eina_matrixsparse_data_idx_get(tm->matrix, row, col);520 521 if (! l)410 if (update->x + update->w - 1 >= tm->tile.w) 411 new_update.w = tm->tile.w - update->x; 412 if (update->y + update->h - 1 >= tm->tile.h) 413 new_update.h = tm->tile.h - update->y; 414 415 t = eina_matrixsparse_data_idx_get(tm->matrix, row, col); 416 417 if (!t) 522 418 return EINA_TRUE; 523 419 524 EINA_INLIST_FOREACH(EINA_INLIST_GET(l), t) { 525 if (!t->updates && !t->stats.full_update) 526 tm->updates = eina_list_append(tm->updates, t); 527 new_update.x = roundf(t->zoom * new_update.x); 528 new_update.y = roundf(t->zoom * new_update.y); 529 new_update.w = roundf(t->zoom * new_update.w); 530 new_update.h = roundf(t->zoom * new_update.h); 531 ewk_tile_update_area(t, &new_update); 532 } 420 if (!t->updates && !t->stats.full_update) 421 tm->updates = eina_list_append(tm->updates, t); 422 ewk_tile_update_area(t, &new_update); 533 423 534 424 return EINA_TRUE; … … 537 427 Eina_Bool ewk_tile_matrix_tile_update_full(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row) 538 428 { 539 Ewk_Tile * l, *t;429 Ewk_Tile *t; 540 430 Eina_Matrixsparse_Cell *cell; 541 431 EINA_SAFETY_ON_NULL_RETURN_VAL(tm, EINA_FALSE); … … 547 437 return EINA_TRUE; 548 438 549 l= eina_matrixsparse_cell_data_get(cell);550 if (! l) {439 t = eina_matrixsparse_cell_data_get(cell); 440 if (!t) { 551 441 CRITICAL("matrix cell with no tile!"); 552 442 return EINA_TRUE; 553 443 } 554 444 555 EINA_INLIST_FOREACH(EINA_INLIST_GET(l), t) { 556 if (!t->updates && !t->stats.full_update) 557 tm->updates = eina_list_append(tm->updates, t); 558 ewk_tile_update_full(t); 559 } 445 if (!t->updates && !t->stats.full_update) 446 tm->updates = eina_list_append(tm->updates, t); 447 ewk_tile_update_full(t); 560 448 561 449 return EINA_TRUE; … … 587 475 h = area->h; 588 476 589 tw = TILE_SIZE_AT_ZOOM(TILE_W, zoom);590 th = TILE_SIZE_AT_ZOOM(TILE_H, zoom);477 tw = tm->tile.w; 478 th = tm->tile.h; 591 479 592 480 // cropping area region to fit matrix … … 631 519 while (eina_tile_grid_slicer_next(&slicer, &info)) { 632 520 unsigned long col, row; 633 Ewk_Tile * l, *t;521 Ewk_Tile *t; 634 522 col = info->col; 635 523 row = info->row; 636 524 637 l= eina_matrixsparse_data_idx_get(tm->matrix, row, col);638 if (! l)525 t = eina_matrixsparse_data_idx_get(tm->matrix, row, col); 526 if (!t) 639 527 continue; 640 528 641 EINA_INLIST_FOREACH(EINA_INLIST_GET(l), t) { 642 if (!t->updates && !t->stats.full_update) 643 tm->updates = eina_list_append(tm->updates, t); 644 if (info->full) 645 ewk_tile_update_full(t); 646 else { 647 if (t->zoom != zoom) 648 ewk_tile_update_full(t); 649 else 650 ewk_tile_update_area(t, &info->rect); 651 } 652 } 529 if (!t->updates && !t->stats.full_update) 530 tm->updates = eina_list_append(tm->updates, t); 531 if (info->full) 532 ewk_tile_update_full(t); 533 else 534 ewk_tile_update_area(t, &info->rect); 653 535 } 654 536 … … 703 585 EINA_ITERATOR_FOREACH(it, cell) { 704 586 unsigned long row, col; 705 E ina_Inlist *l;587 Ewk_Tile *t; 706 588 eina_matrixsparse_cell_position_get(cell, &row, &col); 707 l= eina_matrixsparse_cell_data_get(cell);708 709 if (! l) {589 t = eina_matrixsparse_cell_data_get(cell); 590 591 if (!t) { 710 592 if (!last_empty) { 711 593 last_empty = EINA_TRUE; … … 718 600 printf("\n"); 719 601 } 720 Ewk_Tile *t; 721 722 printf("%3lu,%3lu %10p:", col, row, l); 723 EINA_INLIST_FOREACH(l, t) 724 printf(" [%3lu,%3lu + %dx%d @ %0.3f]%c", 725 t->col, t->row, t->w, t->h, t->zoom, 726 t->visible ? '*': ' '); 602 printf("%3lu,%3lu %10p:", col, row, t); 603 printf(" [%3lu,%3lu + %dx%d @ %0.3f]%c", t->col, t->row, t->w, t->h, t->zoom, t->visible ? '*': ' '); 727 604 printf("\n"); 728 605 } -
trunk/Source/WebKit/efl/ewk/ewk_tiled_matrix.h
r91974 r93683 27 27 28 28 /* matrix of tiles */ 29 Ewk_Tile_Matrix *ewk_tile_matrix_new(Ewk_Tile_Unused_Cache *tuc, unsigned long cols, unsigned long rows, Evas_Colorspace cspace, void (*render_cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void * data);29 Ewk_Tile_Matrix *ewk_tile_matrix_new(Ewk_Tile_Unused_Cache *tuc, unsigned long cols, unsigned long rows, Evas_Colorspace cspace, void (*render_cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void *render_data); 30 30 void ewk_tile_matrix_free(Ewk_Tile_Matrix *tm); 31 31 -
trunk/Source/WebKit/efl/ewk/ewk_tiled_model.c
r91981 r93683 242 242 Ewk_Tile *ewk_tile_new(Evas *evas, Evas_Coord w, Evas_Coord h, float zoom, Evas_Colorspace cspace) 243 243 { 244 Eina_Inlist *l;245 244 Evas_Coord *ec; 246 245 Evas_Colorspace *ecs; … … 271 270 } 272 271 273 DBG("size: %dx%d (%d), zoom: %f, cspace=%d", 274 w, h, area, (double)zoom, cspace); 272 DBG("size: %dx%d (%d), zoom: %f, cspace=%d", w, h, area, (double)zoom, cspace); 275 273 276 274 MALLOC_OR_OOM_RET(t, sizeof(Ewk_Tile), NULL); … … 282 280 evas_object_image_content_hint_set(t->image, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); 283 281 284 l = EINA_INLIST_GET(t);285 l->prev = NULL;286 l->next = NULL;287 288 282 t->visible = 0; 289 283 t->updates = NULL; … … 311 305 evas_object_image_colorspace_set(t->image, t->cspace); 312 306 t->pixels = evas_object_image_data_get(t->image, EINA_TRUE); 313 t->surface = cairo_image_surface_create_for_data 314 (t->pixels, format, w, h, stride); 307 t->surface = cairo_image_surface_create_for_data(t->pixels, format, w, h, stride); 315 308 status = cairo_surface_status(t->surface); 316 309 if (status != CAIRO_STATUS_SUCCESS) {
Note: See TracChangeset
for help on using the changeset viewer.