OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 #ifndef LayerChromium_h | 6 #ifndef LayerChromium_h |
7 #define LayerChromium_h | 7 #define LayerChromium_h |
8 | 8 |
9 #if USE(ACCELERATED_COMPOSITING) | 9 #if USE(ACCELERATED_COMPOSITING) |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 virtual void setIsMask(bool) { } | 190 virtual void setIsMask(bool) { } |
191 virtual void bindContentsTexture() { } | 191 virtual void bindContentsTexture() { } |
192 virtual bool needsContentsScale() const; | 192 virtual bool needsContentsScale() const; |
193 | 193 |
194 void setDebugBorderColor(SkColor); | 194 void setDebugBorderColor(SkColor); |
195 void setDebugBorderWidth(float); | 195 void setDebugBorderWidth(float); |
196 void setDebugName(const std::string&); | 196 void setDebugName(const std::string&); |
197 | 197 |
198 virtual void pushPropertiesTo(CCLayerImpl*); | 198 virtual void pushPropertiesTo(CCLayerImpl*); |
199 | 199 |
200 void clearRenderSurface() { m_renderSurface.clear(); } | 200 void clearRenderSurface() { m_renderSurface.reset(); } |
201 RenderSurfaceChromium* renderSurface() const { return m_renderSurface.get();
} | 201 RenderSurfaceChromium* renderSurface() const { return m_renderSurface.get();
} |
202 void createRenderSurface(); | 202 void createRenderSurface(); |
203 | 203 |
204 float drawOpacity() const { return m_drawOpacity; } | 204 float drawOpacity() const { return m_drawOpacity; } |
205 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } | 205 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } |
206 | 206 |
207 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } | 207 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } |
208 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } | 208 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } |
209 | 209 |
210 LayerChromium* renderTarget() const { ASSERT(!m_renderTarget || m_renderTarg
et->renderSurface()); return m_renderTarget; } | 210 LayerChromium* renderTarget() const { ASSERT(!m_renderTarget || m_renderTarg
et->renderSurface()); return m_renderTarget; } |
(...skipping 26 matching lines...) Expand all Loading... |
237 bool boundsContainPageScale() const { return m_boundsContainPageScale; } | 237 bool boundsContainPageScale() const { return m_boundsContainPageScale; } |
238 | 238 |
239 // Returns true if any of the layer's descendants has content to draw. | 239 // Returns true if any of the layer's descendants has content to draw. |
240 bool descendantDrawsContent(); | 240 bool descendantDrawsContent(); |
241 | 241 |
242 CCLayerTreeHost* layerTreeHost() const { return m_layerTreeHost; } | 242 CCLayerTreeHost* layerTreeHost() const { return m_layerTreeHost; } |
243 | 243 |
244 // Set the priority of all desired textures in this layer. | 244 // Set the priority of all desired textures in this layer. |
245 virtual void setTexturePriorities(const CCPriorityCalculator&) { } | 245 virtual void setTexturePriorities(const CCPriorityCalculator&) { } |
246 | 246 |
247 bool addAnimation(PassOwnPtr<CCActiveAnimation>); | 247 bool addAnimation(scoped_ptr<CCActiveAnimation>); |
248 void pauseAnimation(int animationId, double timeOffset); | 248 void pauseAnimation(int animationId, double timeOffset); |
249 void removeAnimation(int animationId); | 249 void removeAnimation(int animationId); |
250 | 250 |
251 void suspendAnimations(double monotonicTime); | 251 void suspendAnimations(double monotonicTime); |
252 void resumeAnimations(double monotonicTime); | 252 void resumeAnimations(double monotonicTime); |
253 | 253 |
254 CCLayerAnimationController* layerAnimationController() { return m_layerAnima
tionController.get(); } | 254 CCLayerAnimationController* layerAnimationController() { return m_layerAnima
tionController.get(); } |
255 void setLayerAnimationController(PassOwnPtr<CCLayerAnimationController>); | 255 void setLayerAnimationController(scoped_ptr<CCLayerAnimationController>); |
256 PassOwnPtr<CCLayerAnimationController> releaseLayerAnimationController(); | 256 scoped_ptr<CCLayerAnimationController> releaseLayerAnimationController(); |
257 | 257 |
258 void setLayerAnimationDelegate(WebKit::WebAnimationDelegate* layerAnimationD
elegate) { m_layerAnimationDelegate = layerAnimationDelegate; } | 258 void setLayerAnimationDelegate(WebKit::WebAnimationDelegate* layerAnimationD
elegate) { m_layerAnimationDelegate = layerAnimationDelegate; } |
259 | 259 |
260 bool hasActiveAnimation() const; | 260 bool hasActiveAnimation() const; |
261 | 261 |
262 virtual void notifyAnimationStarted(const CCAnimationEvent&, double wallCloc
kTime); | 262 virtual void notifyAnimationStarted(const CCAnimationEvent&, double wallCloc
kTime); |
263 virtual void notifyAnimationFinished(double wallClockTime); | 263 virtual void notifyAnimationFinished(double wallClockTime); |
264 | 264 |
265 virtual Region visibleContentOpaqueRegion() const; | 265 virtual Region visibleContentOpaqueRegion() const; |
266 | 266 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 void removeChild(LayerChromium*); | 311 void removeChild(LayerChromium*); |
312 | 312 |
313 LayerList m_children; | 313 LayerList m_children; |
314 LayerChromium* m_parent; | 314 LayerChromium* m_parent; |
315 | 315 |
316 // LayerChromium instances have a weak pointer to their CCLayerTreeHost. | 316 // LayerChromium instances have a weak pointer to their CCLayerTreeHost. |
317 // This pointer value is nil when a LayerChromium is not in a tree and is | 317 // This pointer value is nil when a LayerChromium is not in a tree and is |
318 // updated via setLayerTreeHost() if a layer moves between trees. | 318 // updated via setLayerTreeHost() if a layer moves between trees. |
319 CCLayerTreeHost* m_layerTreeHost; | 319 CCLayerTreeHost* m_layerTreeHost; |
320 | 320 |
321 OwnPtr<CCLayerAnimationController> m_layerAnimationController; | 321 scoped_ptr<CCLayerAnimationController> m_layerAnimationController; |
322 | 322 |
323 // Layer properties. | 323 // Layer properties. |
324 IntSize m_bounds; | 324 IntSize m_bounds; |
325 | 325 |
326 // Uses layer's content space. | 326 // Uses layer's content space. |
327 IntRect m_visibleContentRect; | 327 IntRect m_visibleContentRect; |
328 | 328 |
329 IntPoint m_scrollPosition; | 329 IntPoint m_scrollPosition; |
330 IntSize m_maxScrollPosition; | 330 IntSize m_maxScrollPosition; |
331 bool m_scrollable; | 331 bool m_scrollable; |
(...skipping 23 matching lines...) Expand all Loading... |
355 bool m_drawCheckerboardForMissingTiles; | 355 bool m_drawCheckerboardForMissingTiles; |
356 bool m_forceRenderSurface; | 356 bool m_forceRenderSurface; |
357 | 357 |
358 WebKit::WebTransformationMatrix m_transform; | 358 WebKit::WebTransformationMatrix m_transform; |
359 WebKit::WebTransformationMatrix m_sublayerTransform; | 359 WebKit::WebTransformationMatrix m_sublayerTransform; |
360 | 360 |
361 // Replica layer used for reflections. | 361 // Replica layer used for reflections. |
362 scoped_refptr<LayerChromium> m_replicaLayer; | 362 scoped_refptr<LayerChromium> m_replicaLayer; |
363 | 363 |
364 // Transient properties. | 364 // Transient properties. |
365 OwnPtr<RenderSurfaceChromium> m_renderSurface; | 365 scoped_ptr<RenderSurfaceChromium> m_renderSurface; |
366 float m_drawOpacity; | 366 float m_drawOpacity; |
367 bool m_drawOpacityIsAnimating; | 367 bool m_drawOpacityIsAnimating; |
368 | 368 |
369 LayerChromium* m_renderTarget; | 369 LayerChromium* m_renderTarget; |
370 | 370 |
371 WebKit::WebTransformationMatrix m_drawTransform; | 371 WebKit::WebTransformationMatrix m_drawTransform; |
372 WebKit::WebTransformationMatrix m_screenSpaceTransform; | 372 WebKit::WebTransformationMatrix m_screenSpaceTransform; |
373 bool m_drawTransformIsAnimating; | 373 bool m_drawTransformIsAnimating; |
374 bool m_screenSpaceTransformIsAnimating; | 374 bool m_screenSpaceTransformIsAnimating; |
375 | 375 |
376 // Uses target surface space. | 376 // Uses target surface space. |
377 IntRect m_drawableContentRect; | 377 IntRect m_drawableContentRect; |
378 float m_contentsScale; | 378 float m_contentsScale; |
379 bool m_boundsContainPageScale; | 379 bool m_boundsContainPageScale; |
380 | 380 |
381 WebKit::WebTransformationMatrix m_implTransform; | 381 WebKit::WebTransformationMatrix m_implTransform; |
382 | 382 |
383 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; | 383 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; |
384 WebKit::WebLayerScrollClient* m_layerScrollClient; | 384 WebKit::WebLayerScrollClient* m_layerScrollClient; |
385 }; | 385 }; |
386 | 386 |
387 void sortLayers(std::vector<scoped_refptr<LayerChromium> >::iterator, std::vecto
r<scoped_refptr<LayerChromium> >::iterator, void*); | 387 void sortLayers(std::vector<scoped_refptr<LayerChromium> >::iterator, std::vecto
r<scoped_refptr<LayerChromium> >::iterator, void*); |
388 | 388 |
389 } | 389 } |
390 #endif // USE(ACCELERATED_COMPOSITING) | 390 #endif // USE(ACCELERATED_COMPOSITING) |
391 | 391 |
392 #endif | 392 #endif |
OLD | NEW |