OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [mw/] [src/] [drivers/] [fbportrait_down.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 673 markom
/*
2
 * Copyright (c) 2001 Greg Haerr <greg@censoft.com>
3
 *
4
 * Portrait mode subdriver for Microwindows
5
 */
6
#include <assert.h>
7
#include <stdio.h>
8
#include <stdlib.h>
9
#include "device.h"
10
#include "fb.h"
11
 
12
static void
13
fbportrait_drawpixel(PSD psd,MWCOORD x, MWCOORD y, MWPIXELVAL c)
14
{
15
        //x = psd->xvirtres-x-1;
16
        psd->orgsubdriver->DrawPixel(psd, x, psd->yvirtres-y-1, c);
17
}
18
 
19
static MWPIXELVAL
20
fbportrait_readpixel(PSD psd,MWCOORD x, MWCOORD y)
21
{
22
        //x = psd->xvirtres-x-1;
23
        return psd->orgsubdriver->ReadPixel(psd, x, psd->yvirtres-y-1);
24
}
25
 
26
static void
27
fbportrait_drawhorzline(PSD psd,MWCOORD x1, MWCOORD x2, MWCOORD y, MWPIXELVAL c)
28
{
29
        //x1 = psd->xvirtres-x1-1;
30
        //x2 = psd->xvirtres-x2-1;
31
        psd->orgsubdriver->DrawHorzLine(psd, x1, x2, psd->yvirtres-y-1, c);
32
}
33
 
34
static void
35
fbportrait_drawvertline(PSD psd,MWCOORD x, MWCOORD y1, MWCOORD y2, MWPIXELVAL c)
36
{
37
        //x = psd->xvirtres-x-1;
38
        psd->orgsubdriver->DrawVertLine(psd, x, psd->yvirtres-y2-1,
39
                psd->yvirtres-y1-1, c);
40
}
41
 
42
static void
43
fbportrait_fillrect(PSD psd,MWCOORD x1, MWCOORD y1, MWCOORD x2, MWCOORD y2,
44
        MWPIXELVAL c)
45
{
46
        y2 = psd->yvirtres-y2-1;
47
        y1 = psd->yvirtres-y1-1;
48
        //x1 = psd->xvirtres-x2-1;
49
        //x2 = psd->xvirtres-x1-1;
50
        while(y2 <= y1)
51
                psd->DrawHorzLine(psd, x1, x2, y2++, c);
52
}
53
 
54
static void
55
fbportrait_blit(PSD dstpsd,MWCOORD destx,MWCOORD desty,MWCOORD w,MWCOORD h,
56
        PSD srcpsd, MWCOORD srcx,MWCOORD srcy,long op)
57
{
58
        //dstpsd->orgsubdriver->Blit(dstpsd, desty, dstpsd->xvirtres-destx-w,
59
                //h, w, srcpsd, srcy, srcpsd->xvirtres-srcx-w, op);
60
}
61
 
62
static void
63
fbportrait_stretchblit(PSD dstpsd, MWCOORD destx, MWCOORD desty, MWCOORD dstw,
64
        MWCOORD dsth, PSD srcpsd, MWCOORD srcx, MWCOORD srcy, MWCOORD srcw,
65
        MWCOORD srch, long op)
66
{
67
        //dstpsd->orgsubdriver->StretchBlit(dstpsd, dstpsd->yvirtres-desty-dsth, destx,
68
                //dsth, dstw, srcpsd, srcpsd->yvirtres-srcy-srch, srcx,
69
                //srch, srcw, op);
70
}
71
 
72
SUBDRIVER fbportrait_down = {
73
        NULL,
74
        fbportrait_drawpixel,
75
        fbportrait_readpixel,
76
        fbportrait_drawhorzline,
77
        fbportrait_drawvertline,
78
        gen_fillrect,
79
        fbportrait_blit,
80
        NULL,
81
        fbportrait_stretchblit
82
};

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.