| Index: components/exo/surface.h
|
| diff --git a/components/exo/surface.h b/components/exo/surface.h
|
| index 45395e955a494fc394d52eda077c809ebbf545e3..ae8a9af21f84b5176fd1a014086c58a528ff8fb8 100644
|
| --- a/components/exo/surface.h
|
| +++ b/components/exo/surface.h
|
| @@ -20,6 +20,7 @@
|
| #include "third_party/skia/include/core/SkRegion.h"
|
| #include "third_party/skia/include/core/SkXfermode.h"
|
| #include "ui/aura/window.h"
|
| +#include "ui/compositor/compositor.h"
|
| #include "ui/compositor/layer_owner_delegate.h"
|
| #include "ui/gfx/geometry/rect.h"
|
|
|
| @@ -86,7 +87,8 @@ class SurfaceFactoryOwner : public base::RefCounted<SurfaceFactoryOwner>,
|
|
|
| // This class represents a rectangular area that is displayed on the screen.
|
| // It has a location, size and pixel contents.
|
| -class Surface : public ui::LayerOwnerDelegate {
|
| +class Surface : public ui::LayerOwnerDelegate,
|
| + public ui::ContextFactoryObserver {
|
| public:
|
| typedef void (*PropertyDeallocator)(int64_t value);
|
|
|
| @@ -206,6 +208,9 @@ class Surface : public ui::LayerOwnerDelegate {
|
| // Overridden from ui::LayerOwnerDelegate:
|
| void OnLayerRecreated(ui::Layer* old_layer, ui::Layer* new_layer) override;
|
|
|
| + // Overridden from ui::ContextFactoryObserver.
|
| + void OnLostResources() override;
|
| +
|
| void WillDraw(cc::SurfaceId surface_id);
|
|
|
| // Check whether this Surface and its children need to create new cc::Surface
|
| @@ -265,6 +270,16 @@ class Surface : public ui::LayerOwnerDelegate {
|
| // Set SurfaceLayer contents to the current buffer.
|
| void SetSurfaceLayerContents(ui::Layer* layer);
|
|
|
| + // Updates current_resource_ with a new resource id corresponding to the
|
| + // contents of the attached buffer (or id 0, if no buffer is attached).
|
| + // UpdateSurface must be called afterwards to ensure the release callback
|
| + // will be called.
|
| + void CreateResource(bool for_commit);
|
| +
|
| + // Updates the current Surface with a new frame referring to the resource in
|
| + // current_resource_.
|
| + void UpdateSurface(bool for_commit);
|
| +
|
| int64_t SetPropertyInternal(const void* key,
|
| const char* name,
|
| PropertyDeallocator deallocator,
|
| @@ -337,6 +352,8 @@ class Surface : public ui::LayerOwnerDelegate {
|
| // The buffer that is currently set as content of surface.
|
| base::WeakPtr<Buffer> current_buffer_;
|
|
|
| + bool frame_is_opaque_ = false;
|
| +
|
| // The last resource that was sent to a surface.
|
| cc::TransferableResource current_resource_;
|
|
|
|
|