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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp

Issue 2720503008: Add cc::SurfaceInfo::is_valid() (Closed)
Patch Set: Added Log() Created 3 years, 9 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
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | ui/aura/mus/window_port_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "platform/graphics/CanvasSurfaceLayerBridge.h" 5 #include "platform/graphics/CanvasSurfaceLayerBridge.h"
6 6
7 #include "cc/layers/layer.h" 7 #include "cc/layers/layer.h"
8 #include "cc/layers/solid_color_layer.h" 8 #include "cc/layers/solid_color_layer.h"
9 #include "cc/layers/surface_layer.h" 9 #include "cc/layers/surface_layer.h"
10 #include "cc/surfaces/sequence_surface_reference_factory.h" 10 #include "cc/surfaces/sequence_surface_reference_factory.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 void CanvasSurfaceLayerBridge::createSolidColorLayer() { 85 void CanvasSurfaceLayerBridge::createSolidColorLayer() {
86 m_CCLayer = cc::SolidColorLayer::Create(); 86 m_CCLayer = cc::SolidColorLayer::Create();
87 m_CCLayer->SetBackgroundColor(SK_ColorTRANSPARENT); 87 m_CCLayer->SetBackgroundColor(SK_ColorTRANSPARENT);
88 m_webLayer = Platform::current()->compositorSupport()->createLayerFromCCLayer( 88 m_webLayer = Platform::current()->compositorSupport()->createLayerFromCCLayer(
89 m_CCLayer.get()); 89 m_CCLayer.get());
90 GraphicsLayer::registerContentsLayer(m_webLayer.get()); 90 GraphicsLayer::registerContentsLayer(m_webLayer.get());
91 } 91 }
92 92
93 void CanvasSurfaceLayerBridge::OnSurfaceCreated( 93 void CanvasSurfaceLayerBridge::OnSurfaceCreated(
94 const cc::SurfaceInfo& surfaceInfo) { 94 const cc::SurfaceInfo& surfaceInfo) {
95 if (!m_currentSurfaceId.is_valid() && surfaceInfo.id().is_valid()) { 95 if (!m_currentSurfaceId.is_valid() && surfaceInfo.is_valid()) {
96 // First time a SurfaceId is received 96 // First time a SurfaceId is received
97 m_currentSurfaceId = surfaceInfo.id(); 97 m_currentSurfaceId = surfaceInfo.id();
98 GraphicsLayer::unregisterContentsLayer(m_webLayer.get()); 98 GraphicsLayer::unregisterContentsLayer(m_webLayer.get());
99 m_webLayer->removeFromParent(); 99 m_webLayer->removeFromParent();
100 100
101 scoped_refptr<cc::SurfaceLayer> surfaceLayer = 101 scoped_refptr<cc::SurfaceLayer> surfaceLayer =
102 cc::SurfaceLayer::Create(m_refFactory); 102 cc::SurfaceLayer::Create(m_refFactory);
103 surfaceLayer->SetPrimarySurfaceInfo(surfaceInfo); 103 surfaceLayer->SetPrimarySurfaceInfo(surfaceInfo);
104 surfaceLayer->SetStretchContentToFillBounds(true); 104 surfaceLayer->SetStretchContentToFillBounds(true);
105 m_CCLayer = surfaceLayer; 105 m_CCLayer = surfaceLayer;
(...skipping 20 matching lines...) Expand all
126 m_service->Satisfy(sequence); 126 m_service->Satisfy(sequence);
127 } 127 }
128 128
129 void CanvasSurfaceLayerBridge::requireCallback( 129 void CanvasSurfaceLayerBridge::requireCallback(
130 const cc::SurfaceId& surfaceId, 130 const cc::SurfaceId& surfaceId,
131 const cc::SurfaceSequence& sequence) { 131 const cc::SurfaceSequence& sequence) {
132 m_service->Require(surfaceId, sequence); 132 m_service->Require(surfaceId, sequence);
133 } 133 }
134 134
135 } // namespace blink 135 } // namespace blink
OLDNEW
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | ui/aura/mus/window_port_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698