~alan-griffiths/mir/knee-jerk-mir_surface_state_automatic

« back to all changes in this revision

Viewing changes to src/surfaces/surface.cpp

  • Committer: Kevin DuBois
  • Date: 2012-11-13 01:36:29 UTC
  • mfrom: (245 trunk)
  • mto: This revision was merged to the branch mainline in revision 246.
  • Revision ID: kevin.dubois@canonical.com-20121113013629-q4496w4mp5e33auk
merge in base branch. move the demo clients to a new directory, examples/

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    std::shared_ptr<mc::BufferBundle> buffer_bundle) :
36
36
    surface_name(name),
37
37
    buffer_bundle(buffer_bundle),
38
 
    alpha_value(1.0f)
 
38
    alpha_value(1.0f),
 
39
    is_hidden(false)
39
40
{
40
41
    // TODO(tvoss,kdub): Does a surface without a buffer_bundle make sense?
41
42
    assert(buffer_bundle);
90
91
    return alpha_value;
91
92
}
92
93
 
 
94
bool ms::Surface::hidden() const
 
95
{
 
96
    return is_hidden;
 
97
}
 
98
 
 
99
void ms::Surface::set_hidden(bool hide)
 
100
{
 
101
    is_hidden = hide;
 
102
}
 
103
 
93
104
//note: not sure the surface should be aware of pixel format. might be something that the 
94
105
//texture (which goes to compositor should be aware of though
95
106
//todo: kdub remove 
137
148
    return *this;
138
149
}
139
150
 
 
151
ms::SurfaceCreationParameters& ms::SurfaceCreationParameters::of_size(
 
152
    geometry::Width::ValueType width, 
 
153
    geometry::Height::ValueType height)
 
154
{
 
155
    return of_size(geometry::Size(geometry::Width(width), geometry::Height(height)));
 
156
}
 
157
 
140
158
ms::SurfaceCreationParameters& ms::SurfaceCreationParameters::of_buffer_usage(
141
159
        mc::BufferUsage new_buffer_usage)
142
160
{