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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2036663003: Establish mojo service between Canvas (blink) and SurfaceManager (browser) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (CanvasRenderingContext* context = canvas->renderingContext()) 121 if (CanvasRenderingContext* context = canvas->renderingContext())
122 return context->isAccelerated(); 122 return context->isAccelerated();
123 } 123 }
124 return false; 124 return false;
125 } 125 }
126 126
127 static inline bool isCanvasControlledByOffscreen(const LayoutObject* layoutObjec t) 127 static inline bool isCanvasControlledByOffscreen(const LayoutObject* layoutObjec t)
128 { 128 {
129 if (layoutObject->isCanvas()) { 129 if (layoutObject->isCanvas()) {
130 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node()); 130 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node());
131 if (canvas->surfaceLayerBridge()) 131 if (canvas->getSurfaceLayerBridge())
132 return true; 132 return true;
133 } 133 }
134 return false; 134 return false;
135 } 135 }
136 136
137 static bool hasBoxDecorationsOrBackgroundImage(const ComputedStyle& style) 137 static bool hasBoxDecorationsOrBackgroundImage(const ComputedStyle& style)
138 { 138 {
139 return style.hasBoxDecorations() || style.hasBackgroundImage(); 139 return style.hasBoxDecorations() || style.hasBackgroundImage();
140 } 140 }
141 141
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 Frame* frame = toHTMLFrameOwnerElement(layoutObject->node())->contentFra me(); 542 Frame* frame = toHTMLFrameOwnerElement(layoutObject->node())->contentFra me();
543 if (frame->isRemoteFrame()) { 543 if (frame->isRemoteFrame()) {
544 WebLayer* layer = toRemoteFrame(frame)->remotePlatformLayer(); 544 WebLayer* layer = toRemoteFrame(frame)->remotePlatformLayer();
545 m_graphicsLayer->setContentsToPlatformLayer(layer); 545 m_graphicsLayer->setContentsToPlatformLayer(layer);
546 } 546 }
547 } else if (layoutObject->isVideo()) { 547 } else if (layoutObject->isVideo()) {
548 HTMLMediaElement* mediaElement = toHTMLMediaElement(layoutObject->node() ); 548 HTMLMediaElement* mediaElement = toHTMLMediaElement(layoutObject->node() );
549 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer( )); 549 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer( ));
550 } else if (isCanvasControlledByOffscreen(layoutObject)) { 550 } else if (isCanvasControlledByOffscreen(layoutObject)) {
551 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node()); 551 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node());
552 m_graphicsLayer->setContentsToPlatformLayer(canvas->surfaceLayerBridge() ->getWebLayer()); 552 m_graphicsLayer->setContentsToPlatformLayer(canvas->getSurfaceLayerBridg e()->getWebLayer());
553 layerConfigChanged = true; 553 layerConfigChanged = true;
554 } else if (isAcceleratedCanvas(layoutObject)) { 554 } else if (isAcceleratedCanvas(layoutObject)) {
555 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node()); 555 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node());
556 if (CanvasRenderingContext* context = canvas->renderingContext()) 556 if (CanvasRenderingContext* context = canvas->renderingContext())
557 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer() ); 557 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer() );
558 layerConfigChanged = true; 558 layerConfigChanged = true;
559 } 559 }
560 if (layoutObject->isLayoutPart()) { 560 if (layoutObject->isLayoutPart()) {
561 if (PaintLayerCompositor::attachFrameContentLayersToIframeLayer(toLayout Part(layoutObject))) 561 if (PaintLayerCompositor::attachFrameContentLayersToIframeLayer(toLayout Part(layoutObject)))
562 layerConfigChanged = true; 562 layerConfigChanged = true;
(...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after
2636 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2636 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2637 name = "Scrolling Contents Layer"; 2637 name = "Scrolling Contents Layer";
2638 } else { 2638 } else {
2639 ASSERT_NOT_REACHED(); 2639 ASSERT_NOT_REACHED();
2640 } 2640 }
2641 2641
2642 return name; 2642 return name;
2643 } 2643 }
2644 2644
2645 } // namespace blink 2645 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698