mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Enable the Sky compositor
Turns out we need to reset the context before switching back to drawing with Ganesh (i.e., call resetContext on the GrContext) to clean out whatever state we've changed in the GL context. Now the city-list and the flights-app demos work. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/752653002
This commit is contained in:
parent
22eee0e624
commit
cc9da50737
@ -27,7 +27,6 @@ void Layer::SetSize(const gfx::Size& size) {
|
||||
void Layer::Display() {
|
||||
DCHECK(host_);
|
||||
|
||||
mojo::GaneshContext::Scope scope(host_->ganesh_context());
|
||||
mojo::GaneshSurface surface(host_->ganesh_context(),
|
||||
host_->resource_manager()->CreateTexture(size_));
|
||||
|
||||
|
||||
@ -49,7 +49,13 @@ void LayerHost::ReturnResources(
|
||||
void LayerHost::BeginFrame(base::TimeTicks frame_time,
|
||||
base::TimeTicks deadline) {
|
||||
client_->BeginFrame(frame_time);
|
||||
root_layer_->Display();
|
||||
|
||||
{
|
||||
mojo::GaneshContext::Scope scope(&ganesh_context_);
|
||||
ganesh_context_.gr()->resetContext();
|
||||
root_layer_->Display();
|
||||
}
|
||||
|
||||
Upload(root_layer_.get());
|
||||
}
|
||||
|
||||
|
||||
@ -171,7 +171,7 @@ blink::WebLayerTreeView* DocumentView::initializeLayerTreeView() {
|
||||
#if ENABLE_SKY_COMPOSITOR
|
||||
|
||||
mojo::Shell* DocumentView::GetShell() {
|
||||
return shell_.get();
|
||||
return shell_;
|
||||
}
|
||||
|
||||
void DocumentView::BeginFrame(base::TimeTicks frame_time) {
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "sky/viewer/services/inspector_impl.h"
|
||||
|
||||
// You can try enabling the Sky compositor, but it's a bit buggy.
|
||||
#define ENABLE_SKY_COMPOSITOR 0
|
||||
#define ENABLE_SKY_COMPOSITOR 1
|
||||
|
||||
namespace base {
|
||||
class MessageLoopProxy;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user