Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.h

Issue 6901134: Merge 84546 - 2011-04-21 Nat Duca <nduca@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24 24
25 #ifndef CCHeadsUpDisplay_h 25 #ifndef CCHeadsUpDisplay_h
26 #define CCHeadsUpDisplay_h 26 #define CCHeadsUpDisplay_h
27 27
28 #if USE(ACCELERATED_COMPOSITING) 28 #if USE(ACCELERATED_COMPOSITING)
29 29
30 #include "Font.h" 30 #include "Font.h"
31 #include "LayerRendererChromium.h" 31 #include "ProgramBinding.h"
32 32 #include "ShaderChromium.h"
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 class GeometryBinding; 36 class GeometryBinding;
37 class GraphicsContext3D; 37 class GraphicsContext3D;
38 class LayerRendererChromium;
39 class LayerTexture;
38 40
39 // Class that handles drawing of composited render layers using GL. 41 // Class that handles drawing of composited render layers using GL.
40 class CCHeadsUpDisplay { 42 class CCHeadsUpDisplay {
41 WTF_MAKE_NONCOPYABLE(CCHeadsUpDisplay); 43 WTF_MAKE_NONCOPYABLE(CCHeadsUpDisplay);
42 public: 44 public:
43 static PassOwnPtr<CCHeadsUpDisplay> create(LayerRendererChromium* owner) 45 static PassOwnPtr<CCHeadsUpDisplay> create(LayerRendererChromium* owner)
44 { 46 {
45 return adoptPtr(new CCHeadsUpDisplay(owner)); 47 return adoptPtr(new CCHeadsUpDisplay(owner));
46 } 48 }
47 49
48 ~CCHeadsUpDisplay(); 50 ~CCHeadsUpDisplay();
49 51
50 void onPresent(); 52 void onPresent();
51 53
52 void setShowFPSCounter(bool enable) { m_showFPSCounter = enable; } 54 void setShowFPSCounter(bool enable) { m_showFPSCounter = enable; }
53 bool showFPSCounter() const { return m_showFPSCounter; } 55 bool showFPSCounter() const { return m_showFPSCounter; }
54 56
55 void setShowPlatformLayerTree(bool enable) { m_showPlatformLayerTree = enabl e; } 57 void setShowPlatformLayerTree(bool enable) { m_showPlatformLayerTree = enabl e; }
56 bool showPlatformLayerTree() const { return m_showPlatformLayerTree; } 58 bool showPlatformLayerTree() const { return m_showPlatformLayerTree; }
57 59
58 bool enabled() const { return m_showPlatformLayerTree || m_showFPSCounter; } 60 bool enabled() const { return m_showPlatformLayerTree || m_showFPSCounter; }
59 void draw(); 61 void draw();
60 62
63 typedef ProgramBinding<VertexShaderPosTex, FragmentShaderBGRATexAlpha> Progr am;
64
61 private: 65 private:
62 explicit CCHeadsUpDisplay(LayerRendererChromium* owner); 66 explicit CCHeadsUpDisplay(LayerRendererChromium* owner);
63 void drawHudContents(GraphicsContext*, const IntSize& hudSize); 67 void drawHudContents(GraphicsContext*, const IntSize& hudSize);
64 void drawFPSCounter(GraphicsContext*, int top, int height); 68 void drawFPSCounter(GraphicsContext*, int top, int height);
65 void drawPlatformLayerTree(GraphicsContext*, int top); 69 void drawPlatformLayerTree(GraphicsContext*, int top);
66 70
67 71
68 int m_currentFrameNumber; 72 int m_currentFrameNumber;
69 73
70 double m_filteredFrameTime; 74 double m_filteredFrameTime;
(...skipping 10 matching lines...) Expand all
81 85
82 OwnPtr<Font> m_smallFont; 86 OwnPtr<Font> m_smallFont;
83 OwnPtr<Font> m_mediumFont; 87 OwnPtr<Font> m_mediumFont;
84 }; 88 };
85 89
86 } 90 }
87 91
88 #endif // USE(ACCELERATED_COMPOSITING) 92 #endif // USE(ACCELERATED_COMPOSITING)
89 93
90 #endif 94 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698