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

Unified Diff: sky/shell/ui/engine.cc

Issue 1131673011: Teach SkyView code path to print hello, world (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: again Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/ui/engine.cc
diff --git a/sky/shell/ui/engine.cc b/sky/shell/ui/engine.cc
index c0e464e319a3504a26634f8b1b94465b0b0f1a90..058682ded13fb10e7eb1d6ff9f8eafaa588c9262 100644
--- a/sky/shell/ui/engine.cc
+++ b/sky/shell/ui/engine.cc
@@ -70,8 +70,10 @@ void Engine::BeginFrame(base::TimeTicks frame_time) {
double interval_sec = 1.0 / 60;
blink::WebBeginFrameArgs args(frame_time_sec, deadline_sec, interval_sec);
- web_view_->beginFrame(args);
- web_view_->layout();
+ if (web_view_) {
+ web_view_->beginFrame(args);
+ web_view_->layout();
+ }
}
skia::RefPtr<SkPicture> Engine::Paint() {
@@ -83,7 +85,9 @@ skia::RefPtr<SkPicture> Engine::Paint() {
physical_size_.width(), physical_size_.height(), &factory,
SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag));
- web_view_->paint(canvas.get(), blink::WebRect(gfx::Rect(physical_size_)));
+ if (web_view_)
+ web_view_->paint(canvas.get(), blink::WebRect(gfx::Rect(physical_size_)));
+
return skia::AdoptRef(recorder.endRecordingAsPicture());
}
@@ -143,6 +147,13 @@ void Engine::OnInputEvent(InputEventPtr event) {
}
void Engine::LoadURL(const mojo::String& url) {
+ // Enable SkyView here.
+ if (false) {
+ sky_view_ = blink::SkyView::Create();
+ sky_view_->Load(GURL(url));
+ return;
+ }
+
// Something bad happens if you try to call WebView::close and replace
// the webview. So for now we just load into the existing one. :/
if (!web_view_)
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698