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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [graphite/] [pr42930.C] - Blame information for rev 315

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

Line No. Rev Author Line
1 301 jeremybenn
/* { dg-options "-O1 -floop-block" } */
2
 
3
typedef unsigned char byte;
4
typedef unsigned int uint;
5
typedef unsigned char uint8;
6
namespace Common {
7
class NonCopyable {
8
};
9
template
10
Out copy(In first, In last, Out dst) {
11
 while (first != last)
12
  *dst++ = *first++;
13
}
14
template
15
class Array {
16
 uint _size;
17
 T *_storage;
18
public:
19
 Array& operator=(const Array &array) {
20
  copy(array._storage, array._storage + _size, _storage);
21
 }
22
};
23
}
24
namespace Graphics {
25
struct PixelFormat {
26
 inline PixelFormat() {
27
 }
28
 inline PixelFormat(byte BytesPerPixel,
29
      byte RBits, byte GBits, byte BBits, byte ABits,
30
      byte RShift, byte GShift, byte BShift, byte AShift) {
31
 }
32
};
33
};
34
namespace Cine {
35
static const Graphics::PixelFormat kLowPalFormat(2, 3, 3, 3, 0, 8, 4, 0, 0);
36
class Palette {
37
public:
38
 struct Color {
39
  uint8 r, g, b;
40
 };
41
 Palette(const Graphics::PixelFormat format = Graphics::PixelFormat(), const uint numColors = 0);
42
 bool empty() const;
43
 bool isValid() const;
44
 Common::Array _colors;
45
};
46
class FWRenderer : public Common::NonCopyable {
47
 Cine::Palette _activePal;
48
 void drawCommand();
49
};
50
void FWRenderer::drawCommand() {
51
 if (!_activePal.isValid() || _activePal.empty()) {
52
  _activePal = Cine::Palette(kLowPalFormat, 16);
53
 }
54
}
55
}

powered by: WebSVN 2.1.0

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