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

Side by Side Diff: Source/core/platform/graphics/GraphicsLayer.h

Issue 63943006: Re-enable solid background color optimization for composited layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add window.internals.forceCompositingUpdate(document) to webgl test to avoid flaky Created 7 years 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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // These methods handle both transitions and keyframe animations. 219 // These methods handle both transitions and keyframe animations.
220 bool addAnimation(PassOwnPtr<blink::WebAnimation>); 220 bool addAnimation(PassOwnPtr<blink::WebAnimation>);
221 void pauseAnimation(int animationId, double /*timeOffset*/); 221 void pauseAnimation(int animationId, double /*timeOffset*/);
222 void removeAnimation(int animationId); 222 void removeAnimation(int animationId);
223 223
224 // Layer contents 224 // Layer contents
225 void setContentsToImage(Image*); 225 void setContentsToImage(Image*);
226 void setContentsToNinePatch(Image*, const IntRect& aperture); 226 void setContentsToNinePatch(Image*, const IntRect& aperture);
227 bool shouldDirectlyCompositeImage(Image*) const { return true; } 227 bool shouldDirectlyCompositeImage(Image*) const { return true; }
228 // Pass an invalid color to remove the contents layer. 228 // Pass an invalid color to remove the contents layer.
229 void setContentsToSolidColor(const Color&) { } 229 void setContentsToSolidColor(const Color&);
230 void setContentsToPlatformLayer(blink::WebLayer* layer) { setContentsTo(laye r); } 230 void setContentsToPlatformLayer(blink::WebLayer* layer) { setContentsTo(laye r); }
231 bool hasContentsLayer() const { return m_contentsLayer; } 231 bool hasContentsLayer() const { return m_contentsLayer; }
232 232
233 // Callback from the underlying graphics system to draw layer contents. 233 // Callback from the underlying graphics system to draw layer contents.
234 void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip); 234 void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
235 // Callback from the underlying graphics system when the layer has been disp layed 235 // Callback from the underlying graphics system when the layer has been disp layed
236 void layerDidDisplay(blink::WebLayer*) { } 236 void layerDidDisplay(blink::WebLayer*) { }
237 237
238 // For hosting this GraphicsLayer in a native layer hierarchy. 238 // For hosting this GraphicsLayer in a native layer hierarchy.
239 blink::WebLayer* platformLayer() const; 239 blink::WebLayer* platformLayer() const;
(...skipping 24 matching lines...) Expand all
264 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const; 264 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const;
265 265
266 // Return an estimate of the backing store memory cost (in bytes). May be in correct for tiled layers. 266 // Return an estimate of the backing store memory cost (in bytes). May be in correct for tiled layers.
267 double backingStoreMemoryEstimate() const; 267 double backingStoreMemoryEstimate() const;
268 268
269 void resetTrackedRepaints(); 269 void resetTrackedRepaints();
270 void addRepaintRect(const FloatRect&); 270 void addRepaintRect(const FloatRect&);
271 271
272 void collectTrackedRepaintRects(Vector<FloatRect>&) const; 272 void collectTrackedRepaintRects(Vector<FloatRect>&) const;
273 273
274 static bool supportsBackgroundColorContent()
275 {
276 return false;
277 }
278
279 void addLinkHighlight(LinkHighlightClient*); 274 void addLinkHighlight(LinkHighlightClient*);
280 void removeLinkHighlight(LinkHighlightClient*); 275 void removeLinkHighlight(LinkHighlightClient*);
281 // Exposed for tests 276 // Exposed for tests
282 unsigned numLinkHighlights() { return m_linkHighlights.size(); } 277 unsigned numLinkHighlights() { return m_linkHighlights.size(); }
283 LinkHighlightClient* linkHighlight(int i) { return m_linkHighlights[i]; } 278 LinkHighlightClient* linkHighlight(int i) { return m_linkHighlights[i]; }
284 279
285 void setScrollableArea(ScrollableArea*, bool isMainFrame); 280 void setScrollableArea(ScrollableArea*, bool isMainFrame);
286 ScrollableArea* scrollableArea() const { return m_scrollableArea; } 281 ScrollableArea* scrollableArea() const { return m_scrollableArea; }
287 282
288 blink::WebContentLayer* contentLayer() const { return m_layer.get(); } 283 blink::WebContentLayer* contentLayer() const { return m_layer.get(); }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer. 374 GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer.
380 FloatPoint m_replicatedLayerPosition; // For a replica layer, the position o f the replica. 375 FloatPoint m_replicatedLayerPosition; // For a replica layer, the position o f the replica.
381 376
382 IntRect m_contentsRect; 377 IntRect m_contentsRect;
383 378
384 int m_paintCount; 379 int m_paintCount;
385 380
386 OwnPtr<blink::WebContentLayer> m_layer; 381 OwnPtr<blink::WebContentLayer> m_layer;
387 OwnPtr<blink::WebImageLayer> m_imageLayer; 382 OwnPtr<blink::WebImageLayer> m_imageLayer;
388 OwnPtr<blink::WebNinePatchLayer> m_ninePatchLayer; 383 OwnPtr<blink::WebNinePatchLayer> m_ninePatchLayer;
384 Color m_contentsSolidColor;
385 OwnPtr<blink::WebSolidColorLayer> m_solidColorLayer;
389 blink::WebLayer* m_contentsLayer; 386 blink::WebLayer* m_contentsLayer;
390 // We don't have ownership of m_contentsLayer, but we do want to know if a g iven layer is the 387 // We don't have ownership of m_contentsLayer, but we do want to know if a g iven layer is the
391 // same as our current layer in setContentsTo(). Since m_contentsLayer may b e deleted at this point, 388 // same as our current layer in setContentsTo(). Since m_contentsLayer may b e deleted at this point,
392 // we stash an ID away when we know m_contentsLayer is alive and use that fo r comparisons from that point 389 // we stash an ID away when we know m_contentsLayer is alive and use that fo r comparisons from that point
393 // on. 390 // on.
394 int m_contentsLayerId; 391 int m_contentsLayerId;
395 392
396 Vector<LinkHighlightClient*> m_linkHighlights; 393 Vector<LinkHighlightClient*> m_linkHighlights;
397 394
398 OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLa yerDelegate; 395 OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLa yerDelegate;
399 396
400 ScrollableArea* m_scrollableArea; 397 ScrollableArea* m_scrollableArea;
401 blink::WebCompositingReasons m_compositingReasons; 398 blink::WebCompositingReasons m_compositingReasons;
402 }; 399 };
403 400
404 401
405 } // namespace WebCore 402 } // namespace WebCore
406 403
407 #ifndef NDEBUG 404 #ifndef NDEBUG
408 // Outside the WebCore namespace for ease of invocation from gdb. 405 // Outside the WebCore namespace for ease of invocation from gdb.
409 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer); 406 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
410 #endif 407 #endif
411 408
412 #endif // GraphicsLayer_h 409 #endif // GraphicsLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698