Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sky/viewer/document_view.h" | 5 #include "sky/viewer/document_view.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 double interval_sec = 1.0/60; | 149 double interval_sec = 1.0/60; |
| 150 blink::WebBeginFrameArgs web_begin_frame_args( | 150 blink::WebBeginFrameArgs web_begin_frame_args( |
| 151 frame_time_sec, deadline_sec, interval_sec); | 151 frame_time_sec, deadline_sec, interval_sec); |
| 152 web_view_->beginFrame(web_begin_frame_args); | 152 web_view_->beginFrame(web_begin_frame_args); |
| 153 web_view_->layout(); | 153 web_view_->layout(); |
| 154 blink::WebSize size = web_view_->size(); | 154 blink::WebSize size = web_view_->size(); |
| 155 root_layer_->SetSize(gfx::Size(size.width, size.height)); | 155 root_layer_->SetSize(gfx::Size(size.width, size.height)); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void DocumentView::OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) { | 158 void DocumentView::OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) { |
| 159 root_->SetSurfaceId(surface_id.Pass()); | 159 if (root_) |
|
jamesr
2014/12/16 00:02:47
this is not directly related, but fixes a flaky sh
esprehn
2014/12/16 00:51:11
Wouldn't we want to shutdown the connection to sur
jamesr
2014/12/16 00:56:09
This isn't about controlling the surface, this is
esprehn
2014/12/16 01:23:57
Why do we even get this message if everything is t
| |
| 160 root_->SetSurfaceId(surface_id.Pass()); | |
| 160 } | 161 } |
| 161 | 162 |
| 162 void DocumentView::PaintContents(SkCanvas* canvas, const gfx::Rect& clip) { | 163 void DocumentView::PaintContents(SkCanvas* canvas, const gfx::Rect& clip) { |
| 163 blink::WebRect rect(clip.x(), clip.y(), clip.width(), clip.height()); | 164 blink::WebRect rect(clip.x(), clip.y(), clip.width(), clip.height()); |
| 164 web_view_->paint(canvas, rect); | 165 web_view_->paint(canvas, rect); |
| 165 } | 166 } |
| 166 | 167 |
| 167 void DocumentView::scheduleAnimation() { | 168 void DocumentView::scheduleAnimation() { |
| 168 DCHECK(web_view_); | 169 DCHECK(web_view_); |
| 169 layer_host_->SetNeedsAnimate(); | 170 layer_host_->SetNeedsAnimate(); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 void DocumentView::StartDebuggerInspectorBackend() { | 278 void DocumentView::StartDebuggerInspectorBackend() { |
| 278 if (!inspector_backend_) { | 279 if (!inspector_backend_) { |
| 279 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); | 280 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); |
| 280 inspector_backend_.reset( | 281 inspector_backend_.reset( |
| 281 new inspector::InspectorBackendMojo(inspector_host_.get())); | 282 new inspector::InspectorBackendMojo(inspector_host_.get())); |
| 282 } | 283 } |
| 283 inspector_backend_->Connect(); | 284 inspector_backend_->Connect(); |
| 284 } | 285 } |
| 285 | 286 |
| 286 } // namespace sky | 287 } // namespace sky |
| OLD | NEW |