summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-02-25 14:17:14 -0500
committerChris Michael <cp.michael@samsung.com>2015-02-25 14:17:14 -0500
commit662c9a2c234f96a9de91073ee86a6ade092d2d15 (patch)
tree4316e6c400c1d71e65ccfb7b9ce9f206d8e15704
parent91270757f38a60f09de96fa23558284693a1305e (diff)
fix compile issues
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/bin/e_comp_wl.c273
1 files changed, 21 insertions, 252 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 4dccdc22b..85713ebb9 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -912,7 +912,7 @@ static void
912_e_comp_wl_surface_state_size_update(E_Client *ec, E_Comp_Wl_Surface_State *state) 912_e_comp_wl_surface_state_size_update(E_Client *ec, E_Comp_Wl_Surface_State *state)
913{ 913{
914 int w = 0, h = 0; 914 int w = 0, h = 0;
915 double scale = 0.0; 915 /* double scale = 0.0; */
916 916
917 if (!ec->comp_data->buffer_ref.buffer) 917 if (!ec->comp_data->buffer_ref.buffer)
918 { 918 {
@@ -921,21 +921,24 @@ _e_comp_wl_surface_state_size_update(E_Client *ec, E_Comp_Wl_Surface_State *stat
921 return; 921 return;
922 } 922 }
923 923
924 scale = e_comp->wl_comp_data->output.scale; 924 /* scale = e_comp->wl_comp_data->output.scale; */
925 switch (e_comp->wl_comp_data->output.transform) 925 /* switch (e_comp->wl_comp_data->output.transform) */
926 { 926 /* { */
927 case WL_OUTPUT_TRANSFORM_90: 927 /* case WL_OUTPUT_TRANSFORM_90: */
928 case WL_OUTPUT_TRANSFORM_270: 928 /* case WL_OUTPUT_TRANSFORM_270: */
929 case WL_OUTPUT_TRANSFORM_FLIPPED_90: 929 /* case WL_OUTPUT_TRANSFORM_FLIPPED_90: */
930 case WL_OUTPUT_TRANSFORM_FLIPPED_270: 930 /* case WL_OUTPUT_TRANSFORM_FLIPPED_270: */
931 w = ec->comp_data->buffer_ref.buffer->h / scale; 931 /* w = ec->comp_data->buffer_ref.buffer->h / scale; */
932 h = ec->comp_data->buffer_ref.buffer->w / scale; 932 /* h = ec->comp_data->buffer_ref.buffer->w / scale; */
933 break; 933 /* break; */
934 default: 934 /* default: */
935 w = ec->comp_data->buffer_ref.buffer->w / scale; 935 /* w = ec->comp_data->buffer_ref.buffer->w / scale; */
936 h = ec->comp_data->buffer_ref.buffer->h / scale; 936 /* h = ec->comp_data->buffer_ref.buffer->h / scale; */
937 break; 937 /* break; */
938 } 938 /* } */
939
940 w = ec->comp_data->buffer_ref.buffer->w;
941 h = ec->comp_data->buffer_ref.buffer->h;
939 942
940 state->bw = w; 943 state->bw = w;
941 state->bh = h; 944 state->bh = h;
@@ -1558,240 +1561,6 @@ _e_comp_wl_compositor_cb_del(E_Comp *comp)
1558 free(cdata); 1561 free(cdata);
1559} 1562}
1560 1563
1561static void
1562_e_comp_wl_subsurface_destroy(struct wl_resource *resource)
1563{
1564 E_Client *ec;
1565 E_Comp_Wl_Subsurf_Data *sdata;
1566 Eina_Rectangle *dmg;
1567
1568 /* try to get the client from resource data */
1569 if (!(ec = wl_resource_get_user_data(resource))) return;
1570
1571 if (!ec->comp_data) return;
1572
1573 if (!(sdata = ec->comp_data->sub.data)) return;
1574
1575 if (sdata->parent)
1576 {
1577 /* remove this client from parents sub list */
1578 sdata->parent->comp_data->sub.list =
1579 eina_list_remove(sdata->parent->comp_data->sub.list, ec);
1580 }
1581
1582 /* release buffer */
1583 if (sdata->cached.buffer) wl_buffer_send_release(sdata->cached.buffer);
1584
1585 /* the client is getting deleted, which means the pixmap will be getting
1586 * freed. We need to unset the surface user data */
1587 /* wl_resource_set_user_data(ec->comp_data->surface, NULL); */
1588
1589 EINA_LIST_FREE(sdata->cached.damages, dmg)
1590 eina_rectangle_free(dmg);
1591
1592 if (sdata->cached.input)
1593 eina_tiler_free(sdata->cached.input);
1594
1595 E_FREE(sdata);
1596
1597 ec->comp_data->sub.data = NULL;
1598}
1599
1600static Eina_Bool
1601_e_comp_wl_subsurface_synchronized_get(E_Comp_Wl_Subsurf_Data *sdata)
1602{
1603 while (sdata)
1604 {
1605 if (sdata->synchronized) return EINA_TRUE;
1606 if (!sdata->parent) return EINA_FALSE;
1607 sdata = sdata->parent->comp_data->sub.data;
1608 }
1609
1610 return EINA_FALSE;
1611}
1612
1613static void
1614_e_comp_wl_subsurface_commit_to_cache(E_Client *ec)
1615{
1616 E_Comp_Client_Data *cdata;
1617 E_Comp_Wl_Subsurf_Data *sdata;
1618 Eina_Rectangle *dmg;
1619 Eina_List *l;
1620
1621 if (!(cdata = ec->comp_data)) return;
1622 if (!(sdata = cdata->sub.data)) return;
1623
1624 DBG("Subsurface Commit to Cache");
1625
1626 /* move pending damage to cached */
1627 EINA_LIST_FOREACH(cdata->pending.damages, l, dmg)
1628 eina_list_move(&sdata->cached.damages, &cdata->pending.damages, dmg);
1629
1630 DBG("\tList Count After Move: %d", eina_list_count(cdata->pending.damages));
1631
1632 sdata->cached.x = cdata->pending.x;
1633 sdata->cached.y = cdata->pending.y;
1634 sdata->cached.buffer = cdata->pending.buffer;
1635 sdata->cached.new_attach = cdata->pending.new_attach;
1636
1637 eina_tiler_union(sdata->cached.input, cdata->pending.input);
1638
1639 sdata->cached.has_data = EINA_TRUE;
1640}
1641
1642static void
1643_e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
1644{
1645 E_Comp_Client_Data *cdata;
1646 E_Comp_Wl_Subsurf_Data *sdata;
1647 E_Pixmap *ep;
1648 Eina_Rectangle *dmg;
1649 Eina_Tiler *src, *tmp;
1650
1651 if (!(cdata = ec->comp_data)) return;
1652 if (!(sdata = cdata->sub.data)) return;
1653 if (!(ep = ec->pixmap)) return;
1654
1655 DBG("Subsurface Commit from Cache");
1656
1657 if (sdata->cached.buffer)
1658 {
1659 /* mark the pixmap as usable or not */
1660 e_pixmap_usable_set(ep, (sdata->cached.buffer != NULL));
1661 }
1662
1663 /* mark the pixmap as dirty */
1664 e_pixmap_dirty(ep);
1665
1666 e_pixmap_image_clear(ep, EINA_FALSE);
1667 e_pixmap_resource_set(ep, sdata->cached.buffer);
1668
1669 /* refresh pixmap */
1670 if (e_pixmap_refresh(ep))
1671 {
1672 e_comp->post_updates = eina_list_append(e_comp->post_updates, ec);
1673 e_object_ref(E_OBJECT(ec));
1674 }
1675
1676 /* check if we need to map this surface */
1677 if (sdata->cached.buffer)
1678 {
1679 /* if this surface is not mapped yet, map it */
1680 if (!cdata->mapped)
1681 {
1682 /* if the client has a shell map, call it */
1683 if ((cdata->shell.surface) && (cdata->shell.map))
1684 cdata->shell.map(cdata->shell.surface);
1685 }
1686 }
1687 else
1688 {
1689 /* no pending buffer to attach. unmap the surface */
1690 if (cdata->mapped)
1691 {
1692 /* if the client has a shell map, call it */
1693 if ((cdata->shell.surface) && (cdata->shell.unmap))
1694 cdata->shell.unmap(cdata->shell.surface);
1695 }
1696 }
1697
1698 /* check for any pending attachments */
1699 if (sdata->cached.new_attach)
1700 {
1701 int x, y, nw, nh;
1702 Eina_Bool placed = EINA_TRUE;
1703
1704 e_pixmap_size_get(ec->pixmap, &nw, &nh);
1705 if (ec->changes.pos)
1706 e_comp_object_frame_xy_adjust(ec->frame, ec->x, ec->y, &x, &y);
1707 else
1708 x = ec->client.x, y = ec->client.y;
1709 if (ec->new_client)
1710 placed = ec->placed;
1711 /* if the client has a shell configure, call it */
1712 if ((cdata->shell.surface) && (cdata->shell.configure))
1713 cdata->shell.configure(cdata->shell.surface, x, y, nw, nh);
1714 if (ec->new_client)
1715 ec->placed = placed;
1716 }
1717
1718 if (!cdata->mapped)
1719 {
1720 DBG("\tSurface Not Mapped. Skip to Unmapped");
1721 goto unmap;
1722 }
1723
1724 /* commit any pending damages */
1725 if ((!ec->comp->nocomp) && (ec->frame))
1726 {
1727 EINA_LIST_FREE(sdata->cached.damages, dmg)
1728 {
1729 e_comp_object_damage(ec->frame, dmg->x, dmg->y, dmg->w, dmg->h);
1730 eina_rectangle_free(dmg);
1731 }
1732 }
1733
1734 /* handle pending input */
1735 if (sdata->cached.input)
1736 {
1737 tmp = eina_tiler_new(ec->w, ec->h);
1738 eina_tiler_tile_size_set(tmp, 1, 1);
1739 eina_tiler_rect_add(tmp,
1740 &(Eina_Rectangle){0, 0, ec->client.w, ec->client.h});
1741
1742 if ((src = eina_tiler_intersection(sdata->cached.input, tmp)))
1743 {
1744 Eina_Rectangle *rect;
1745 Eina_Iterator *itr;
1746 int i = 0;
1747
1748 ec->shape_input_rects_num = 0;
1749
1750 itr = eina_tiler_iterator_new(src);
1751 EINA_ITERATOR_FOREACH(itr, rect)
1752 ec->shape_input_rects_num += 1;
1753
1754 ec->shape_input_rects =
1755 malloc(sizeof(Eina_Rectangle) * ec->shape_input_rects_num);
1756
1757 if (ec->shape_input_rects)
1758 {
1759 EINA_ITERATOR_FOREACH(itr, rect)
1760 {
1761 ec->shape_input_rects[i] =
1762 *(Eina_Rectangle *)((char *)rect);
1763
1764 ec->shape_input_rects[i].x = rect->x;
1765 ec->shape_input_rects[i].y = rect->y;
1766 ec->shape_input_rects[i].w = rect->w;
1767 ec->shape_input_rects[i].h = rect->h;
1768
1769 i++;
1770 }
1771 }
1772=======
1773>>>>>>> start work on fixing resize issue
1774
1775 wl_resource_set_implementation(res, &_e_comp_interface, comp, NULL);
1776}
1777
1778static void
1779_e_comp_wl_compositor_cb_del(E_Comp *comp)
1780{
1781 E_Comp_Data *cdata;
1782
1783 /* get existing compositor data */
1784 if (!(cdata = comp->wl_comp_data)) return;
1785
1786 /* delete fd handler */
1787 if (cdata->fd_hdlr) ecore_main_fd_handler_del(cdata->fd_hdlr);
1788
1789 eina_list_free(cdata->output.resources);
1790
1791 /* free allocated data structure */
1792 free(cdata);
1793}
1794
1795static void 1564static void
1796_e_comp_wl_subsurface_destroy(struct wl_resource *resource) 1565_e_comp_wl_subsurface_destroy(struct wl_resource *resource)
1797{ 1566{
@@ -2298,8 +2067,8 @@ _e_comp_wl_compositor_create(void)
2298 wl_signal_init(&cdata->signals.surface.activate); 2067 wl_signal_init(&cdata->signals.surface.activate);
2299 wl_signal_init(&cdata->signals.surface.kill); 2068 wl_signal_init(&cdata->signals.surface.kill);
2300 2069
2301 cdata->output.transform = WL_OUTPUT_TRANSFORM_NORMAL; 2070 /* cdata->output.transform = WL_OUTPUT_TRANSFORM_NORMAL; */
2302 cdata->output.scale = e_scale; 2071 /* cdata->output.scale = e_scale; */
2303 2072
2304 /* try to add compositor to wayland globals */ 2073 /* try to add compositor to wayland globals */
2305 if (!wl_global_create(cdata->wl.disp, &wl_compositor_interface, 2074 if (!wl_global_create(cdata->wl.disp, &wl_compositor_interface,