OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/shell/ui/engine.h" | 5 #include "sky/shell/ui/engine.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "mojo/public/cpp/application/connect.h" | 9 #include "mojo/public/cpp/application/connect.h" |
10 #include "sky/engine/public/platform/WebInputEvent.h" | 10 #include "sky/engine/public/platform/WebInputEvent.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 void Engine::BeginFrame(base::TimeTicks frame_time) { | 67 void Engine::BeginFrame(base::TimeTicks frame_time) { |
68 TRACE_EVENT0("sky", "Engine::BeginFrame"); | 68 TRACE_EVENT0("sky", "Engine::BeginFrame"); |
69 | 69 |
70 double frame_time_sec = (frame_time - base::TimeTicks()).InSecondsF(); | 70 double frame_time_sec = (frame_time - base::TimeTicks()).InSecondsF(); |
71 double deadline_sec = frame_time_sec; | 71 double deadline_sec = frame_time_sec; |
72 double interval_sec = 1.0 / 60; | 72 double interval_sec = 1.0 / 60; |
73 blink::WebBeginFrameArgs args(frame_time_sec, deadline_sec, interval_sec); | 73 blink::WebBeginFrameArgs args(frame_time_sec, deadline_sec, interval_sec); |
74 | 74 |
| 75 if (sky_view_) |
| 76 sky_view_->BeginFrame(frame_time); |
| 77 |
75 if (web_view_) { | 78 if (web_view_) { |
76 web_view_->beginFrame(args); | 79 web_view_->beginFrame(args); |
77 web_view_->layout(); | 80 web_view_->layout(); |
78 } | 81 } |
79 } | 82 } |
80 | 83 |
81 skia::RefPtr<SkPicture> Engine::Paint() { | 84 skia::RefPtr<SkPicture> Engine::Paint() { |
82 TRACE_EVENT0("sky", "Engine::Paint"); | 85 TRACE_EVENT0("sky", "Engine::Paint"); |
83 | 86 |
84 SkRTreeFactory factory; | 87 SkRTreeFactory factory; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 void Engine::scheduleVisualUpdate() { | 199 void Engine::scheduleVisualUpdate() { |
197 animator_->RequestFrame(); | 200 animator_->RequestFrame(); |
198 } | 201 } |
199 | 202 |
200 void Engine::didCreateIsolate(blink::WebLocalFrame* frame, | 203 void Engine::didCreateIsolate(blink::WebLocalFrame* frame, |
201 Dart_Isolate isolate) { | 204 Dart_Isolate isolate) { |
202 Internals::Create(isolate, | 205 Internals::Create(isolate, |
203 CreateServiceProvider(config_.service_provider_context)); | 206 CreateServiceProvider(config_.service_provider_context)); |
204 } | 207 } |
205 | 208 |
206 void Engine::SchedulePaint() { | 209 void Engine::ScheduleFrame() { |
207 animator_->RequestFrame(); | 210 animator_->RequestFrame(); |
208 } | 211 } |
209 | 212 |
210 blink::ServiceProvider* Engine::services() { | 213 blink::ServiceProvider* Engine::services() { |
211 return this; | 214 return this; |
212 } | 215 } |
213 | 216 |
214 mojo::NavigatorHost* Engine::NavigatorHost() { | 217 mojo::NavigatorHost* Engine::NavigatorHost() { |
215 return this; | 218 return this; |
216 } | 219 } |
217 | 220 |
218 void Engine::RequestNavigate(mojo::Target target, | 221 void Engine::RequestNavigate(mojo::Target target, |
219 mojo::URLRequestPtr request) { | 222 mojo::URLRequestPtr request) { |
220 // Ignoring target for now. | 223 // Ignoring target for now. |
221 base::MessageLoop::current()->PostTask(FROM_HERE, | 224 base::MessageLoop::current()->PostTask(FROM_HERE, |
222 base::Bind(&Engine::LoadURL, GetWeakPtr(), request->url)); | 225 base::Bind(&Engine::LoadURL, GetWeakPtr(), request->url)); |
223 } | 226 } |
224 | 227 |
225 void Engine::DidNavigateLocally(const mojo::String& url) { | 228 void Engine::DidNavigateLocally(const mojo::String& url) { |
226 } | 229 } |
227 | 230 |
228 void Engine::RequestNavigateHistory(int32_t delta) { | 231 void Engine::RequestNavigateHistory(int32_t delta) { |
229 NOTIMPLEMENTED(); | 232 NOTIMPLEMENTED(); |
230 } | 233 } |
231 | 234 |
232 } // namespace shell | 235 } // namespace shell |
233 } // namespace sky | 236 } // namespace sky |
OLD | NEW |