line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::SpriteBuilder::ImageDriver::Fake; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
CSS::SpriteBuilder::ImageDriver::Fake - Fake class. |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=cut |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
108
|
|
10
|
4
|
|
|
4
|
|
18
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
161
|
|
11
|
4
|
|
|
4
|
|
19
|
use base 'CSS::SpriteBuilder::ImageDriver::Common'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
2233
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
6
|
|
|
6
|
1
|
35
|
my ($class, @args) = @_; |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
|
|
35
|
my $self = $class->SUPER::new( |
17
|
|
|
|
|
|
|
_width => 0, |
18
|
|
|
|
|
|
|
_height => 0, |
19
|
|
|
|
|
|
|
@args, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
6
|
|
|
|
|
20
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
24
|
|
|
24
|
1
|
147
|
sub width { $_[0]->{_width} } |
26
|
12
|
|
|
12
|
1
|
66
|
sub height { $_[0]->{_height} } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub reset { |
29
|
12
|
|
|
12
|
1
|
20
|
my ($self, $image) = @_; |
30
|
|
|
|
|
|
|
|
31
|
12
|
100
|
|
|
|
20
|
if ($image) { |
32
|
3
|
|
|
|
|
8
|
$self->{_width} = $image->width(); |
33
|
3
|
|
|
|
|
8
|
$self->{_height} = $image->height(); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
else { |
36
|
9
|
|
|
|
|
63
|
$self->{_width} = $self->{_height} = 0; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
12
|
|
|
|
|
27
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub read { |
43
|
3
|
|
|
3
|
1
|
5
|
my ($self, $filename) = @_; |
44
|
|
|
|
|
|
|
|
45
|
3
|
|
|
|
|
117
|
$self->{_width} = $self->{_height} = 32; |
46
|
|
|
|
|
|
|
|
47
|
3
|
|
|
|
|
9
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub write { |
51
|
3
|
|
|
3
|
1
|
6
|
my ($self, $filename) = @_; |
52
|
|
|
|
|
|
|
|
53
|
3
|
50
|
|
|
|
413
|
open(my $fh, '>', $filename) or die "Failed to open file '$filename' due: $!"; |
54
|
3
|
|
|
|
|
9
|
binmode $fh; |
55
|
3
|
|
|
|
|
46
|
print $fh "Fake"; |
56
|
3
|
50
|
|
|
|
172
|
close $fh or die "Failed to close file '$filename' due: $!"; |
57
|
|
|
|
|
|
|
|
58
|
3
|
|
|
|
|
15
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub extent { |
62
|
0
|
|
|
0
|
1
|
|
my ($self, $width, $height) = @_; |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
$self->{_width} = $width; |
65
|
0
|
|
|
|
|
|
$self->{_height} = $height; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
0
|
1
|
|
sub composite { |
71
|
|
|
|
|
|
|
#Nothing |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |