~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libdevice/rawfb/test_rawfb.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-04 03:19:06 UTC
  • mfrom: (1.1.18) (3.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120304031906-p6q5rnb0xhgpof7o
Tags: 0.8.10-3ubuntu1
* Merge from Debian testing (FFe: LP: #940876), remaining changes:
  - Use mozilla-flashplugin as the alternative for now
  - Change xulrunner-dev build dep to firefox-dev
* Drop the plugin API porting patch, this has been fixed upstream
  - drop debian/patches*
* Drop the following change as we want Adobe's player to take priority
  if it's installed
  - Set alternative priority to 50 so that it matches Adobe Flash's priority

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// 
2
 
//   Copyright (C) 2010 Free Software Foundation, Inc
 
2
//   Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc
3
3
// 
4
4
// This program is free software; you can redistribute it and/or modify
5
5
// it under the terms of the GNU General Public License as published by
56
56
    dbglogfile.setVerbosity();
57
57
 
58
58
    rawfb::RawFBDevice rfb;
59
 
 
60
 
    bool ret = rfb.initDevice(argc, argv);
61
 
    if (ret <= 0) {
62
 
        exit(0);
63
 
    }
64
59
    
65
 
    if (ret && (rfb.getHandle() > 0)) {
 
60
    if (!rfb.initDevice(argc, argv)) {
 
61
        runtest.fail("RawFBDevice:InitDevice()");
 
62
    } else {
66
63
        runtest.pass("RawFBDevice:InitDevice()");
67
 
    } else {
68
 
        runtest.fail("RawFBDevice:InitDevice()");
69
64
    }
70
65
 
 
66
    bool ret = rfb.attachWindow(rfb.getHandle());
 
67
    if (rfb.getFBMemory()) {
 
68
        runtest.pass("RawFBDevice::attachWindow()");
 
69
    } else {
 
70
        runtest.fail("RawFBDevice::attachWindow()");
 
71
    }
 
72
    
 
73
#ifdef ENABLE_DOUBLE_BUFFERING
 
74
    if (rfb.getOffscreenBuffer()) {
 
75
        runtest.pass("RawFBDevice::getOffscreenBuffer()");
 
76
    } else {
 
77
        runtest.fail("RawFBDevice::getOffscreenBuffer()");
 
78
    }
 
79
#else
 
80
    runtest.untested("RawFBDevice::getOffscreenBuffer()");
 
81
#endif
 
82
    
 
83
    if (ret && rfb.getStride()) {
 
84
        runtest.pass("RawFBDevice::getStride()");
 
85
    } else {
 
86
        runtest.fail("RawFBDevice::getStride()");
 
87
    }
 
88
    
71
89
    if (ret && rfb.getWidth()) {
72
90
        runtest.pass("RawFBDevice::getWidth()");
73
91
    } else {
139
157
    }
140
158
#endif
141
159
 
142
 
#if 1
143
160
    // This is a manual test to see if we can draw a line on the
144
161
    // raw framebuffer to make sure it got initialized correctly.
145
162
    int x = 0, y = 0;
146
163
    long location = 0;
147
 
    int line_length = rfb.getWidth() * ((rfb.getDepth()+7)/8);
148
 
 
149
 
    boost::uint8_t *fbp = rfb.getFBMemory();
150
 
 
 
164
    int line_length = rfb.getStride();
 
165
 
 
166
    boost::uint8_t *fbp = 0;
 
167
    fbp = rfb.getFBMemory();
 
168
    
151
169
    for(y=100; y<102; y++);            /* Where we are going to put the pixel */
152
170
    
153
171
    for(x=0; x<200; x++) {
159
177
        *(fbp + location + 2) = 200; /* A lot of red */
160
178
        *(fbp + location + 3) = 0; /* No transparency */
161
179
    }
162
 
#endif
163
 
 
164
180
}
165
181
 
166
182
// Local Variables: