~hikiko/mir/mir.unity8-desktop-session

« back to all changes in this revision

Viewing changes to src/server/scene/surface_data.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Kevin Gunn, Ubuntu daily release
  • Date: 2013-11-28 10:05:20 UTC
  • mfrom: (1.1.53)
  • Revision ID: package-import@ubuntu.com-20131128100520-nm0l2ltdr2nj0q4w
Tags: 0.1.2+14.04.20131128.1-0ubuntu1
[ Kevin Gunn ]
* New upstream release 0.1.2
  - graphics: android: improve interface for mga::DisplayDevice so its
    just concerned with rendering and posting.
  - surfaces: rename "surfaces" component to "scene".
  - surfaces, shell: Migrate Session data model from shell to surfaces.
  - graphics: change fill_ipc_package() to use real pointers.
  - mir_client_library.h: Fix typo "do and locking" should be "do any
    locking".
  - API enumerations cleanup: Remove slightly misleading *_enum_max_
    values, and replace them with more accurate plural forms.
  - test_android_communication_package: Do not expect opened fd to be >0,
    we may have closed stdin making this a valid value (LP: #1247718).
  - Update docs about running Mir on the desktop to mention new package
    ubuntu-desktop-mir.
  - offscreen: Add a display that renders its output to offscreen buffers
  - graphics: android: fix regression for hwc1.0 devices introduced in r1228
    (LP: #1252433).
  - OffscreenPlatform provides the services that the offscreen display
    needs from the Platform.
  - graphics: android: consolidate the GLContexts classes in use.
  - Fix uninitialized variable causing random drm_auth_magic test
    failures. (LP: #1252144).
  - Add a fullyish functional Udev wrapper. This currently sits in
    graphics/gbm, but will be moved to the top-level when input device
    detection migrates.
  - Add resizing support to example code; demo-shell and clients.
  - eglapp: Clarify messages about pixel formats (LP: #1168304).
  - Adds support to the MirMotionEvent under pointer_coordinates called
    tool_type. This will allow clients to tell what type of tool is
    being used, from mouse/finger/etc. (LP: #1252498)
  - client,frontend: Report the real available surface pixel formats to
    clients. (LP: #1240833)
  - graphics: android: 1) change hwc1.1 to make use of sync fences during
    the compositor's gl renderloop. Note that we no longer wait for the
    render to complete, we pass this responsibility to the driver and the
    kernel. 2) support nexus 10. (LP: #1252173) (LP: #1203268)
  - shell: don't publish SurfacesContainer - it can be private to shell.
  - gbm: Don't mess up the VT mode on setup failure Only restore the
    previous VT mode during shutdown if it was VT_AUTO.
  - Fix a crash due to a failed eglMakeCurrent() call when in nested mode.
  - shell: unity-mir uses shell::FocusSetter - make the header public again
  - Add resize support to client surfaces (mir::client::MirSurface).
  - graphics: android: support 'old aka 2012' nexus 7 hwc (nvidia tegra3
    SoC) better. (LP: #1231917)
  - Add resize support to *ClientBuffer classes. Now always get dimensions
    from the latest buffer package.
  - android: support driver hooks for the Mali T604 (present in nexus 10)
  - Add width and height to the protocol Buffer messages, in preparation
    for resizable surfaces.
  - surfaces, shell, logging, tests: don't publish headers
    that can be private to surfaces. surfaces/basic_surface.h,
    surfaces/surface_controller.h and shell/surface_builder.h
  - examples: Restore GL framebuffer binding when destroying the render
    target
  - examples, surfaces, shell: remove render_surfaces dependency on
    BasicSurface
  - geometry: remove implementation of streaming operators from headers
    (LP: #1247820)
  - Eliminate the registration order focus sequence, folding it's
    functionality in to the session container.
  - Ensure the session mediator releases acquired buffer resources before
    attempting to acquire a new buffer on behalf of the client. This fixes
    performance regression (LP: #1249210).
  - Some cleanups to test_client_input.cpp.
  - Factor out a bunch of "ClientConfigCommon".
  - Small cleanup to session container test to increase encapsulation.
  - shell, surfaces: Another step in "fixing" the surfaces hierarchies -
    only publish interfaces and putting the data model into surfaces.
  - graphics: android: HWC1.1 use EGL to get further information about
    the framebuffer pixel format.
  - Fix FTBS using use_debflags=ON (building for android-armhf).
    (LP: #1248014)
  - Add a client input receiver report.
  - doc: doxygen 1.8.4 complains about an obsolete config so ran "doxygen
    u Doxyfile.in".
  - Implement resize() for the server-side Surface classes.
  - android: clean up mga::DisplayBuffer and mga::DisplayBufferFactory
  - Add resize() support to BufferStream, in preparation for resizable
    surfaces.
  - Merge metadata changes from the newly reconstructed lp:mir
  - tests: Deduplicate mg::GraphicBufferAllocator stubs.
  - examples: Remove spurious use of mir/shell/surface.h.
  - frontend: remove ClientTrackingSurface from the Surface class
    hierarchy
  - Bumping ABI on server to libmirserver11.
  - Don't mention "Renderable". That interface hasn't existed for quite
    some time now.
  - android-input: Assign more unique touch ids

[ Ubuntu daily release ]
* Automatic snapshot from revision 1167

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2013 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3,
 
6
 * as published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
 
17
 */
 
18
 
 
19
#ifndef MIR_SCENE_SURFACE_DATA_STORAGE_H_
 
20
#define MIR_SCENE_SURFACE_DATA_STORAGE_H_
 
21
 
 
22
#include "surface_state.h"
 
23
 
 
24
#include <vector>
 
25
#include <functional>
 
26
#include <mutex>
 
27
 
 
28
namespace mir
 
29
{
 
30
namespace scene
 
31
{
 
32
 
 
33
class SurfaceData : public SurfaceState
 
34
{
 
35
public:
 
36
    SurfaceData(std::string const& name, geometry::Rectangle rect,
 
37
                std::function<void()> change_cb,
 
38
                bool nonrectangular);
 
39
 
 
40
    //mc::CompositingCriteria
 
41
    glm::mat4 const& transformation() const;
 
42
    float alpha() const;
 
43
    bool should_be_rendered_in(geometry::Rectangle const& rect) const;
 
44
    bool shaped() const override;
 
45
 
 
46
    //mi::Surface
 
47
    std::string const& name() const;
 
48
    geometry::Point position() const;
 
49
    geometry::Size size() const;
 
50
    bool contains(geometry::Point const& point) const;
 
51
 
 
52
    //ms::MutableSurfaceState
 
53
    void move_to(geometry::Point);
 
54
    void resize(geometry::Size const& size);
 
55
    void frame_posted();
 
56
    void set_hidden(bool hidden);
 
57
    void apply_alpha(float alpha);
 
58
    void apply_rotation(float degrees, glm::vec3 const&);
 
59
    void set_input_region(std::vector<geometry::Rectangle> const& input_rectangles);
 
60
 
 
61
private:
 
62
    std::mutex mutable guard;
 
63
    std::function<void()> notify_change;
 
64
    std::string surface_name;
 
65
    geometry::Rectangle surface_rect;
 
66
    glm::mat4 rotation_matrix;
 
67
    mutable glm::mat4 transformation_matrix;
 
68
    mutable geometry::Size transformation_size;
 
69
    mutable bool transformation_dirty;
 
70
    float surface_alpha;
 
71
    bool first_frame_posted;
 
72
    bool hidden;
 
73
    const bool nonrectangular;
 
74
    std::vector<geometry::Rectangle> input_rectangles;
 
75
};
 
76
 
 
77
}
 
78
}
 
79
#endif /* MIR_SCENE_SURFACE_DATA_STORAGE_H_ */