Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: ui/base/x/x11_util.cc

Issue 13648004: Fix silly bugs around overscan flag detection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/base/x/x11_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file defines utility functions for X11 (Linux only). This code has been 5 // This file defines utility functions for X11 (Linux only). This code has been
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support
7 // remains woefully incomplete. 7 // remains woefully incomplete.
8 8
9 #include "ui/base/x/x11_util.h" 9 #include "ui/base/x/x11_util.h"
10 10
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 // - byte 1 high 3 bits: tag. '07' for extended tags. 1436 // - byte 1 high 3 bits: tag. '07' for extended tags.
1437 // - byte 1 remaining bits: the length of data block. 1437 // - byte 1 remaining bits: the length of data block.
1438 // - byte 2: the extended tag. '0' for video capability. 1438 // - byte 2: the extended tag. '0' for video capability.
1439 // - byte 3: the capability. 1439 // - byte 3: the capability.
1440 unsigned char tag = data_block[0] >> 5; 1440 unsigned char tag = data_block[0] >> 5;
1441 unsigned char payload_length = data_block[0] & 0x1f; 1441 unsigned char payload_length = data_block[0] & 0x1f;
1442 if (static_cast<unsigned long>(data_block + payload_length - prop) > 1442 if (static_cast<unsigned long>(data_block + payload_length - prop) >
1443 nitems) 1443 nitems)
1444 break; 1444 break;
1445 1445
1446 if (tag != kExtendedTag && payload_length < 2) { 1446 if (tag != kExtendedTag || payload_length < 2) {
1447 data_block += payload_length + 1; 1447 data_block += payload_length + 1;
1448 continue; 1448 continue;
1449 } 1449 }
1450 1450
1451 unsigned char extended_tag_code = data_block[1]; 1451 unsigned char extended_tag_code = data_block[1];
1452 if (extended_tag_code != kExtendedVideoCapabilityTag) { 1452 if (extended_tag_code != kExtendedVideoCapabilityTag) {
1453 data_block += payload_length; 1453 data_block += payload_length + 1;
1454 continue; 1454 continue;
1455 } 1455 }
1456 1456
1457 // The difference between preferred, IT, and CE video formats 1457 // The difference between preferred, IT, and CE video formats
1458 // doesn't matter. Sets |flag| to true if any of these flags are true. 1458 // doesn't matter. Sets |flag| to true if any of these flags are true.
1459 if ((data_block[2] & (1 << kPTOverscan)) || 1459 if ((data_block[2] & (1 << kPTOverscan)) ||
1460 (data_block[2] & (1 << kITOverscan)) || 1460 (data_block[2] & (1 << kITOverscan)) ||
1461 (data_block[2] & (1 << kCEOverscan))) { 1461 (data_block[2] & (1 << kCEOverscan))) {
1462 *flag = true; 1462 *flag = true;
1463 } else { 1463 } else {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 << "request_code " << static_cast<int>(error_event.request_code) << ", " 1794 << "request_code " << static_cast<int>(error_event.request_code) << ", "
1795 << "minor_code " << static_cast<int>(error_event.minor_code) 1795 << "minor_code " << static_cast<int>(error_event.minor_code)
1796 << " (" << request_str << ")"; 1796 << " (" << request_str << ")";
1797 } 1797 }
1798 1798
1799 // ---------------------------------------------------------------------------- 1799 // ----------------------------------------------------------------------------
1800 // End of x11_util_internal.h 1800 // End of x11_util_internal.h
1801 1801
1802 1802
1803 } // namespace ui 1803 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/base/x/x11_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698