Teach SkyView path to draw a circle
This CL adds a global view object that can receive a Picture and be signaled to draw. When using SkyView, this Picture shows up on screen. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1134913003
This commit is contained in:
@@ -85,6 +85,13 @@ skia::RefPtr<SkPicture> Engine::Paint() {
|
||||
physical_size_.width(), physical_size_.height(), &factory,
|
||||
SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag));
|
||||
|
||||
if (sky_view_) {
|
||||
skia::RefPtr<SkPicture> picture = sky_view_->Paint();
|
||||
canvas->clear(SK_ColorBLACK);
|
||||
if (picture)
|
||||
canvas->drawPicture(picture.get());
|
||||
}
|
||||
|
||||
if (web_view_)
|
||||
web_view_->paint(canvas.get(), blink::WebRect(gfx::Rect(physical_size_)));
|
||||
|
||||
@@ -149,7 +156,7 @@ void Engine::OnInputEvent(InputEventPtr event) {
|
||||
void Engine::LoadURL(const mojo::String& url) {
|
||||
// Enable SkyView here.
|
||||
if (false) {
|
||||
sky_view_ = blink::SkyView::Create();
|
||||
sky_view_ = blink::SkyView::Create(this);
|
||||
sky_view_->Load(GURL(url));
|
||||
return;
|
||||
}
|
||||
@@ -182,6 +189,10 @@ void Engine::didCreateIsolate(blink::WebLocalFrame* frame,
|
||||
CreateServiceProvider(config_.service_provider_context));
|
||||
}
|
||||
|
||||
void Engine::SchedulePaint() {
|
||||
animator_->RequestFrame();
|
||||
}
|
||||
|
||||
blink::ServiceProvider* Engine::services() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "skia/ext/refptr.h"
|
||||
#include "sky/engine/public/platform/ServiceProvider.h"
|
||||
#include "sky/engine/public/sky/sky_view.h"
|
||||
#include "sky/engine/public/sky/sky_view_client.h"
|
||||
#include "sky/engine/public/web/WebFrameClient.h"
|
||||
#include "sky/engine/public/web/WebViewClient.h"
|
||||
#include "sky/shell/gpu_delegate.h"
|
||||
@@ -34,7 +35,8 @@ class Engine : public UIDelegate,
|
||||
public blink::ServiceProvider,
|
||||
public mojo::NavigatorHost,
|
||||
public blink::WebFrameClient,
|
||||
public blink::WebViewClient {
|
||||
public blink::WebViewClient,
|
||||
public blink::SkyViewClient {
|
||||
public:
|
||||
struct Config {
|
||||
ServiceProviderContext* service_provider_context;
|
||||
@@ -75,6 +77,9 @@ class Engine : public UIDelegate,
|
||||
void didCreateIsolate(blink::WebLocalFrame* frame,
|
||||
Dart_Isolate isolate) override;
|
||||
|
||||
// SkyViewClient methods:
|
||||
void SchedulePaint() override;
|
||||
|
||||
// Services methods:
|
||||
mojo::NavigatorHost* NavigatorHost() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user