OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa _intel.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa _intel.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "gpu/command_buffer/service/framebuffer_manager.h" | 8 #include "gpu/command_buffer/service/framebuffer_manager.h" |
9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
10 #include "ui/gl/gl_context.h" | 10 #include "ui/gl/gl_context.h" |
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1559 bool(packedEdgesL & 0x08u) && | 1559 bool(packedEdgesL & 0x08u) && |
1560 bool(packedEdgesT & 0x01u); | 1560 bool(packedEdgesT & 0x01u); |
1561 bool large_l3 = (packedEdgesC == (0x04u | 0x08u)) && | 1561 bool large_l3 = (packedEdgesC == (0x04u | 0x08u)) && |
1562 bool(packedEdgesR & 0x08u) && | 1562 bool(packedEdgesR & 0x08u) && |
1563 bool(packedEdgesT & 0x04u); | 1563 bool(packedEdgesT & 0x04u); |
1564 bool large_l4 = (packedEdgesC == (0x02u | 0x04u)) && | 1564 bool large_l4 = (packedEdgesC == (0x02u | 0x04u)) && |
1565 bool(packedEdgesR & 0x02u) && | 1565 bool(packedEdgesR & 0x02u) && |
1566 bool(packedEdgesB & 0x04u); | 1566 bool(packedEdgesB & 0x04u); |
1567 if (large_l1 || large_l2 || large_l3 || large_l4) | 1567 if (large_l1 || large_l2 || large_l3 || large_l4) |
1568 continue; | 1568 continue; |
1569 | |
1570 // Don't blend isolated L shape because it's not a closed geometry. | |
1571 // isolated_l1 isolated_l2 isolated_l3 isolated_l4 | |
1572 // _ _ | |
1573 // X| X| |X |X | |
1574 // ¯¯ ¯¯ | |
1575 bool isolated_l1 = (packedEdgesC == (0x01u | 0x02u)) && | |
1576 bool((packedEdgesL & 0x02u) == 0x00u) && | |
Zhenyao Mo
2016/07/05 01:47:27
I didn't review the original CLs, but chrome doesn
Zhenyao Mo
2016/07/05 01:50:39
Never mind. Just realized it's shader source, so
dshwang
2016/07/05 11:41:26
Yes, I will apply clang-format.
| |
1577 bool((packedEdgesT & 0x04u) == 0x00u) && | |
1578 bool((packedEdgesR & 0x08u) == 0x00u) && | |
1579 bool((packedEdgesB & 0x01u) == 0x00u); | |
1580 bool isolated_l2 = (packedEdgesC == (0x01u | 0x08u)) && | |
1581 bool((packedEdgesL & 0x08u) == 0x00u) && | |
1582 bool((packedEdgesT & 0x01u) == 0x00u) && | |
1583 bool((packedEdgesR & 0x02u) == 0x00u) && | |
1584 bool((packedEdgesB & 0x04u) == 0x00u); | |
1585 bool isolated_l3 = (packedEdgesC == (0x04u | 0x08u)) && | |
1586 bool((packedEdgesL & 0x02u) == 0x00u) && | |
1587 bool((packedEdgesT & 0x04u) == 0x00u) && | |
1588 bool((packedEdgesR & 0x08u) == 0x00u) && | |
1589 bool((packedEdgesB & 0x01u) == 0x00u); | |
1590 bool isolated_l4 = (packedEdgesC == (0x02u | 0x04u)) && | |
1591 bool((packedEdgesL & 0x08u) == 0x00u) && | |
1592 bool((packedEdgesT & 0x01u) == 0x00u) && | |
1593 bool((packedEdgesR & 0x02u) == 0x00u) && | |
1594 bool((packedEdgesB & 0x04u) == 0x00u); | |
1595 if (isolated_l1 || isolated_l2 || isolated_l3 || isolated_l4) | |
1596 continue; | |
1569 } | 1597 } |
1570 | 1598 |
1571 // 2.) U-like shape (surrounded with edges from 3 sides) | 1599 // 2.) U-like shape (surrounded with edges from 3 sides) |
1572 if (numberOfEdges == 3.0) { | 1600 if (numberOfEdges == 3.0) { |
1573 // with value of 0.13, the pixel will retain approx 72% of its | 1601 // with value of 0.13, the pixel will retain approx 72% of its |
1574 // colour and the remaining 28% will be picked from its 3 | 1602 // colour and the remaining 28% will be picked from its 3 |
1575 // neighbours (which are unlikely to be blurred too but could be) | 1603 // neighbours (which are unlikely to be blurred too but could be) |
1576 blurCoeff = 0.13; | 1604 blurCoeff = 0.13; |
1577 } | 1605 } |
1578 | 1606 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1869 \n#ifdef OUT_FBO\n | 1897 \n#ifdef OUT_FBO\n |
1870 outColor = pixel; | 1898 outColor = pixel; |
1871 \n#else\n | 1899 \n#else\n |
1872 imageStore(outTexture, screenPosI, pixel); | 1900 imageStore(outTexture, screenPosI, pixel); |
1873 \n#endif\n | 1901 \n#endif\n |
1874 } | 1902 } |
1875 ); | 1903 ); |
1876 /* clang-format on */ | 1904 /* clang-format on */ |
1877 | 1905 |
1878 } // namespace gpu | 1906 } // namespace gpu |
OLD | NEW |