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

Side by Side Diff: ui/gfx/compositor/compositor_cc.cc

Issue 8510076: Fix stale compositor references from ui::Layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux_touch build Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/compositor/compositor.cc ('k') | ui/gfx/compositor/layer.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/gfx/compositor/compositor_cc.h" 5 #include "ui/gfx/compositor/compositor_cc.h"
6 6
7 #include "third_party/skia/include/images/SkImageEncoder.h" 7 #include "third_party/skia/include/images/SkImageEncoder.h"
8 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFloatPoint.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFloatPoint.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void CompositorCC::OnNotifyEnd() { 167 void CompositorCC::OnNotifyEnd() {
168 } 168 }
169 169
170 void CompositorCC::OnWidgetSizeChanged() { 170 void CompositorCC::OnWidgetSizeChanged() {
171 host_.setViewportSize(size()); 171 host_.setViewportSize(size());
172 root_web_layer_.setBounds(size()); 172 root_web_layer_.setBounds(size());
173 } 173 }
174 174
175 void CompositorCC::OnRootLayerChanged() { 175 void CompositorCC::OnRootLayerChanged() {
176 root_web_layer_.removeAllChildren(); 176 root_web_layer_.removeAllChildren();
177 root_web_layer_.addChild(root_layer()->web_layer()); 177 if (root_layer())
178 root_web_layer_.addChild(root_layer()->web_layer());
178 } 179 }
179 180
180 void CompositorCC::DrawTree() { 181 void CompositorCC::DrawTree() {
181 host_.composite(); 182 host_.composite();
182 } 183 }
183 184
184 bool CompositorCC::ReadPixels(SkBitmap* bitmap) { 185 bool CompositorCC::ReadPixels(SkBitmap* bitmap) {
185 bitmap->setConfig(SkBitmap::kARGB_8888_Config, 186 bitmap->setConfig(SkBitmap::kARGB_8888_Config,
186 size().width(), size().height()); 187 size().width(), size().height());
187 bitmap->allocPixels(); 188 bitmap->allocPixels();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 ScheduleDraw(); 226 ScheduleDraw();
226 } 227 }
227 228
228 Compositor* Compositor::Create(CompositorDelegate* owner, 229 Compositor* Compositor::Create(CompositorDelegate* owner,
229 gfx::AcceleratedWidget widget, 230 gfx::AcceleratedWidget widget,
230 const gfx::Size& size) { 231 const gfx::Size& size) {
231 return new CompositorCC(owner, widget, size); 232 return new CompositorCC(owner, widget, size);
232 } 233 }
233 234
234 } // namespace ui 235 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/compositor/compositor.cc ('k') | ui/gfx/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698