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

Subversion Repositories or1k

[/] [or1k/] [tags/] [MW_0_8_9PRE7/] [mw/] [src/] [drivers/] [fbportrait_left.c] - Blame information for rev 674

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 673 markom
/*
2
 * Copyright (c) 2000, 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
        psd->orgsubdriver->DrawPixel(psd, y, psd->xvirtres-x-1, c);
16
}
17
 
18
static MWPIXELVAL
19
fbportrait_readpixel(PSD psd,MWCOORD x, MWCOORD y)
20
{
21
        return psd->orgsubdriver->ReadPixel(psd, y, psd->xvirtres-x-1);
22
}
23
 
24
static void
25
fbportrait_drawhorzline(PSD psd,MWCOORD x1, MWCOORD x2, MWCOORD y, MWPIXELVAL c)
26
{
27
        psd->orgsubdriver->DrawVertLine(psd, y, psd->xvirtres-x2-1,
28
                psd->xvirtres-x1-1, c);
29
 
30
        /*
31
         * Uncomment the following if driver doesn't support hline
32
        x2 = psd->xvirtres-x2-1;
33
        while(x2 <= (psd->xvirtres-x1-1))
34
                fb_drawpixel(psd, y, x2++, c);
35
         */
36
}
37
 
38
static void
39
fbportrait_drawvertline(PSD psd,MWCOORD x, MWCOORD y1, MWCOORD y2, MWPIXELVAL c)
40
{
41
        psd->orgsubdriver->DrawHorzLine(psd, y1, y2, psd->xvirtres-x-1, c);
42
 
43
        /*
44
         * Uncomment the following if driver doesn't support vline
45
        while(y1 <= y2)
46
                fb_drawpixel(psd, y1++, psd->xvirtres-x-1, c);
47
         */
48
}
49
 
50
static void
51
fbportrait_fillrect(PSD psd,MWCOORD x1, MWCOORD y1, MWCOORD x2, MWCOORD y2,
52
        MWPIXELVAL c)
53
{
54
        x1 = psd->xvirtres-x1-1;
55
        x2 = psd->xvirtres-x2-1;
56
        while(x2 <= x1)
57
                psd->orgsubdriver->DrawHorzLine(psd, y1, y2, x2++, c);
58
}
59
 
60
static void
61
fbportrait_blit(PSD dstpsd,MWCOORD destx,MWCOORD desty,MWCOORD w,MWCOORD h,
62
        PSD srcpsd, MWCOORD srcx,MWCOORD srcy,long op)
63
{
64
        dstpsd->orgsubdriver->Blit(dstpsd, desty, dstpsd->xvirtres-destx-w,
65
                h, w, srcpsd, srcy, srcpsd->xvirtres-srcx-w, op);
66
}
67
 
68
static void
69
fbportrait_stretchblit(PSD dstpsd, MWCOORD destx, MWCOORD desty, MWCOORD dstw,
70
        MWCOORD dsth, PSD srcpsd, MWCOORD srcx, MWCOORD srcy, MWCOORD srcw,
71
        MWCOORD srch, long op)
72
{
73
        //dstpsd->orgsubdriver->StretchBlit(dstpsd, desty, dstpsd->xvirtres-destx-dstw,
74
                //dsth, dstw, srcpsd, srcy, srcpsd->xvirtres-srcx-srcw, 
75
                //srch, srcw, op);
76
}
77
 
78
SUBDRIVER fbportrait_left = {
79
        NULL,
80
        fbportrait_drawpixel,
81
        fbportrait_readpixel,
82
        fbportrait_drawhorzline,
83
        fbportrait_drawvertline,
84
        gen_fillrect,
85
        fbportrait_blit,
86
        NULL,
87
        fbportrait_stretchblit
88
};

powered by: WebSVN 2.1.0

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