OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // A Layer containing a WebGL canvas | 45 // A Layer containing a WebGL canvas |
46 class WebGLLayerChromium : public CanvasLayerChromium { | 46 class WebGLLayerChromium : public CanvasLayerChromium { |
47 public: | 47 public: |
48 static PassRefPtr<WebGLLayerChromium> create(GraphicsLayerChromium* owner =
0); | 48 static PassRefPtr<WebGLLayerChromium> create(GraphicsLayerChromium* owner =
0); |
49 | 49 |
50 virtual ~WebGLLayerChromium(); | 50 virtual ~WebGLLayerChromium(); |
51 | 51 |
52 virtual bool drawsContent() const; | 52 virtual bool drawsContent() const; |
53 virtual void updateCompositorResources(); | 53 virtual void updateCompositorResources(); |
54 void setTextureUpdated(); | 54 void setTextureUpdated(); |
| 55 bool paintRenderedResultsToCanvas(ImageBuffer*); |
55 | 56 |
56 void setContext(const GraphicsContext3D* context); | 57 void setContext(const GraphicsContext3D* context); |
57 GraphicsContext3D* context() { return m_context; } | 58 GraphicsContext3D* context() { return m_context; } |
58 | 59 |
59 virtual void setLayerRenderer(LayerRendererChromium*); | 60 virtual void setLayerRenderer(LayerRendererChromium*); |
60 | 61 |
61 protected: | 62 protected: |
62 virtual const char* layerTypeAsString() const { return "WebGLLayer"; } | 63 virtual const char* layerTypeAsString() const { return "WebGLLayer"; } |
63 | 64 |
64 private: | 65 private: |
65 explicit WebGLLayerChromium(GraphicsLayerChromium* owner); | 66 explicit WebGLLayerChromium(GraphicsLayerChromium* owner); |
66 friend class WebGLLayerChromiumRateLimitTask; | 67 friend class WebGLLayerChromiumRateLimitTask; |
67 | 68 |
68 void rateLimitContext(Timer<WebGLLayerChromium>*); | 69 void rateLimitContext(Timer<WebGLLayerChromium>*); |
69 | 70 |
70 // GraphicsContext3D::platformLayer has a side-effect of assigning itself | 71 // GraphicsContext3D::platformLayer has a side-effect of assigning itself |
71 // to the layer. Because of that GraphicsContext3D's destructor will reset | 72 // to the layer. Because of that GraphicsContext3D's destructor will reset |
72 // layer's context to 0. | 73 // layer's context to 0. |
73 GraphicsContext3D* m_context; | 74 GraphicsContext3D* m_context; |
74 bool m_contextSupportsRateLimitingExtension; | 75 bool m_contextSupportsRateLimitingExtension; |
75 Timer<WebGLLayerChromium> m_rateLimitingTimer; | 76 Timer<WebGLLayerChromium> m_rateLimitingTimer; |
76 bool m_textureUpdated; | 77 bool m_textureUpdated; |
77 }; | 78 }; |
78 | 79 |
79 } | 80 } |
80 #endif // USE(ACCELERATED_COMPOSITING) | 81 #endif // USE(ACCELERATED_COMPOSITING) |
81 | 82 |
82 #endif | 83 #endif |
OLD | NEW |