~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/Platform/chromium/public/WebLayerTreeViewClient.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
 
3
 *
 
4
 * Redistribution and use in source and binary forms, with or without
 
5
 * modification, are permitted provided that the following conditions
 
6
 * are met:
 
7
 *
 
8
 * 1.  Redistributions of source code must retain the above copyright
 
9
 *     notice, this list of conditions and the following disclaimer.
 
10
 * 2.  Redistributions in binary form must reproduce the above copyright
 
11
 *     notice, this list of conditions and the following disclaimer in the
 
12
 *     documentation and/or other materials provided with the distribution.
 
13
 *
 
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
24
 */
 
25
 
 
26
#ifndef WebLayerTreeViewClient_h
 
27
#define WebLayerTreeViewClient_h
 
28
 
 
29
class SkBitmap;
 
30
 
 
31
namespace WebKit {
 
32
class WebCompositorOutputSurface;
 
33
class WebInputHandler;
 
34
class WebThread;
 
35
struct WebRect;
 
36
struct WebSize;
 
37
 
 
38
class WebLayerTreeViewClient {
 
39
public:
 
40
    // Indicates to the embedder that the compositor is about to begin a
 
41
    // frame. This is is a signal to flow control mechanisms that a frame is
 
42
    // beginning. This call will be followed by updateAnimations and then
 
43
    // layout, which should be used for actual animation or tree manipulation
 
44
    // tasks.  FIXME: make pure virtual once upstream deps are satisfied.
 
45
    virtual void willBeginFrame() { }
 
46
 
 
47
    // Indicates that main thread tasks associated with frame rendering have completed.
 
48
    // Issued unconditionally, even if the context was lost in the process.
 
49
    virtual void didBeginFrame() { }
 
50
 
 
51
    // Updates animation and layout. These are called before the compositing
 
52
    // pass so that layers can be updated at the given frame time.
 
53
    virtual void updateAnimations(double monotonicFrameBeginTime) = 0;
 
54
    virtual void layout() = 0;
 
55
 
 
56
    // Applies a scroll delta to the root layer, which is bundled with a page
 
57
    // scale factor that may apply a CSS transform on the whole document (used
 
58
    // for mobile-device pinch zooming). This is triggered by events sent to the
 
59
    // compositor thread through the WebCompositor interface.
 
60
    virtual void applyScrollAndScale(const WebSize& scrollDelta, float scaleFactor) = 0;
 
61
 
 
62
    // Creates the output surface. This may be called more than once
 
63
    // if the context gets lost.
 
64
    virtual WebCompositorOutputSurface* createOutputSurface() { return 0; }
 
65
 
 
66
    // Signals a successful recreation of the output surface (e.g. after a lost
 
67
    // 3D context event).
 
68
    virtual void didRecreateOutputSurface(bool success) { }
 
69
 
 
70
    virtual WebInputHandler* createInputHandler() { return 0; }
 
71
 
 
72
    // Indicates that a frame will be committed to the impl side of the compositor
 
73
    // for rendering.
 
74
    virtual void willCommit() { }
 
75
 
 
76
    // Indicates that a frame was committed to the impl side of the compositor
 
77
    // for rendering.
 
78
    //
 
79
    // FIXME: make this non-virtual when ui/compositor DEP is resolved.
 
80
    virtual void didCommit() { }
 
81
 
 
82
    // Indicates that a frame was committed to the impl side and drawing
 
83
    // commands for it were issued to the GPU.
 
84
    virtual void didCommitAndDrawFrame() = 0;
 
85
 
 
86
    // Indicates that a frame previously issued to the GPU has completed
 
87
    // rendering.
 
88
    virtual void didCompleteSwapBuffers() = 0;
 
89
 
 
90
    // Schedules a compositing pass, meaning the client should call
 
91
    // WebLayerTreeView::composite at a later time. This is only called if the
 
92
    // compositor thread is disabled; when enabled, the compositor will
 
93
    // internally schedule a compositing pass when needed.
 
94
    virtual void scheduleComposite() = 0;
 
95
 
 
96
    // Creates a font atlas to use for debug visualizations. The atlas is a bitmap
 
97
    // containing glyph data, a table of ASCII character values to a subrectangle
 
98
    // of the atlas representing the corresponding glyph, and the glyph height.
 
99
    virtual void createFontAtlas(SkBitmap&, WebRect asciiToRectTable[128], int& fontHeight) { }
 
100
 
 
101
protected:
 
102
    virtual ~WebLayerTreeViewClient() { }
 
103
};
 
104
 
 
105
} // namespace WebKit
 
106
 
 
107
#endif // WebLayerTreeViewClient_h