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

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: 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void setContentsToMedia(blink::WebLayer*); // video or plug-in 228 void setContentsToMedia(blink::WebLayer*); // video or plug-in
229 // Pass an invalid color to remove the contents layer. 229 // Pass an invalid color to remove the contents layer.
230 void setContentsToSolidColor(const Color&) { } 230 void setContentsToSolidColor(const Color&);
231 void setContentsToCanvas(blink::WebLayer*); 231 void setContentsToCanvas(blink::WebLayer*);
232 // FIXME: webkit.org/b/109658 232 // FIXME: webkit.org/b/109658
233 // Should unify setContentsToMedia and setContentsToCanvas 233 // Should unify setContentsToMedia and setContentsToCanvas
234 void setContentsToPlatformLayer(blink::WebLayer* layer) { setContentsToMedia (layer); } 234 void setContentsToPlatformLayer(blink::WebLayer* layer) { setContentsToMedia (layer); }
235 bool hasContentsLayer() const { return m_contentsLayer; } 235 bool hasContentsLayer() const { return m_contentsLayer; }
236 236
237 // Callback from the underlying graphics system to draw layer contents. 237 // Callback from the underlying graphics system to draw layer contents.
238 void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip); 238 void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
239 // Callback from the underlying graphics system when the layer has been disp layed 239 // Callback from the underlying graphics system when the layer has been disp layed
240 void layerDidDisplay(blink::WebLayer*) { } 240 void layerDidDisplay(blink::WebLayer*) { }
(...skipping 25 matching lines...) Expand all
266 // Return a string with a human readable form of the layer tree, If debug is true 266 // Return a string with a human readable form of the layer tree, If debug is true
267 // pointers for the layers and timing data will be included in the returned string. 267 // pointers for the layers and timing data will be included in the returned string.
268 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const; 268 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const;
269 269
270 // Return an estimate of the backing store memory cost (in bytes). May be in correct for tiled layers. 270 // Return an estimate of the backing store memory cost (in bytes). May be in correct for tiled layers.
271 double backingStoreMemoryEstimate() const; 271 double backingStoreMemoryEstimate() const;
272 272
273 void resetTrackedRepaints(); 273 void resetTrackedRepaints();
274 void addRepaintRect(const FloatRect&); 274 void addRepaintRect(const FloatRect&);
275 275
276 static bool supportsBackgroundColorContent()
277 {
278 return false;
279 }
280
281 void addLinkHighlight(LinkHighlightClient*); 276 void addLinkHighlight(LinkHighlightClient*);
282 void removeLinkHighlight(LinkHighlightClient*); 277 void removeLinkHighlight(LinkHighlightClient*);
283 // Exposed for tests 278 // Exposed for tests
284 unsigned numLinkHighlights() { return m_linkHighlights.size(); } 279 unsigned numLinkHighlights() { return m_linkHighlights.size(); }
285 LinkHighlightClient* linkHighlight(int i) { return m_linkHighlights[i]; } 280 LinkHighlightClient* linkHighlight(int i) { return m_linkHighlights[i]; }
286 281
287 void setScrollableArea(ScrollableArea*, bool isMainFrame); 282 void setScrollableArea(ScrollableArea*, bool isMainFrame);
288 ScrollableArea* scrollableArea() const { return m_scrollableArea; } 283 ScrollableArea* scrollableArea() const { return m_scrollableArea; }
289 284
290 blink::WebContentLayer* contentLayer() const { return m_layer.get(); } 285 blink::WebContentLayer* contentLayer() const { return m_layer.get(); }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer. 376 GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer.
382 FloatPoint m_replicatedLayerPosition; // For a replica layer, the position o f the replica. 377 FloatPoint m_replicatedLayerPosition; // For a replica layer, the position o f the replica.
383 378
384 IntRect m_contentsRect; 379 IntRect m_contentsRect;
385 380
386 int m_paintCount; 381 int m_paintCount;
387 382
388 OwnPtr<blink::WebContentLayer> m_layer; 383 OwnPtr<blink::WebContentLayer> m_layer;
389 OwnPtr<blink::WebImageLayer> m_imageLayer; 384 OwnPtr<blink::WebImageLayer> m_imageLayer;
390 OwnPtr<blink::WebNinePatchLayer> m_ninePatchLayer; 385 OwnPtr<blink::WebNinePatchLayer> m_ninePatchLayer;
386 Color m_contentsSolidColor;
387 OwnPtr<blink::WebSolidColorLayer> m_solidColorLayer;
391 blink::WebLayer* m_contentsLayer; 388 blink::WebLayer* m_contentsLayer;
392 // We don't have ownership of m_contentsLayer, but we do want to know if a g iven layer is the 389 // We don't have ownership of m_contentsLayer, but we do want to know if a g iven layer is the
393 // same as our current layer in setContentsTo(). Since m_contentsLayer may b e deleted at this point, 390 // same as our current layer in setContentsTo(). Since m_contentsLayer may b e deleted at this point,
394 // we stash an ID away when we know m_contentsLayer is alive and use that fo r comparisons from that point 391 // we stash an ID away when we know m_contentsLayer is alive and use that fo r comparisons from that point
395 // on. 392 // on.
396 int m_contentsLayerId; 393 int m_contentsLayerId;
397 394
398 Vector<LinkHighlightClient*> m_linkHighlights; 395 Vector<LinkHighlightClient*> m_linkHighlights;
399 396
400 OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLa yerDelegate; 397 OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLa yerDelegate;
401 398
402 ScrollableArea* m_scrollableArea; 399 ScrollableArea* m_scrollableArea;
403 blink::WebCompositingReasons m_compositingReasons; 400 blink::WebCompositingReasons m_compositingReasons;
404 }; 401 };
405 402
406 403
407 } // namespace WebCore 404 } // namespace WebCore
408 405
409 #ifndef NDEBUG 406 #ifndef NDEBUG
410 // Outside the WebCore namespace for ease of invocation from gdb. 407 // Outside the WebCore namespace for ease of invocation from gdb.
411 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer); 408 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
412 #endif 409 #endif
413 410
414 #endif // GraphicsLayer_h 411 #endif // GraphicsLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698