| Index: ui/gfx/ozone/dri/dri_surface.cc
|
| diff --git a/ui/gfx/ozone/dri/dri_surface.cc b/ui/gfx/ozone/dri/dri_surface.cc
|
| index c9b6af4b562c53dfd4790926064b762d861459ac..2f892319ac70f380566c6970e9b33e09bfb774a6 100644
|
| --- a/ui/gfx/ozone/dri/dri_surface.cc
|
| +++ b/ui/gfx/ozone/dri/dri_surface.cc
|
| @@ -48,6 +48,13 @@ DriSurface::DriSurface(
|
| }
|
|
|
| DriSurface::~DriSurface() {
|
| + for (unsigned int i = 0; i < 2; ++i) {
|
| + // If the surface fails to initialize, it may not have all the buffers
|
| + // created. If we fail to register a framebuffer than there is no reason to
|
| + // unregister it.
|
| + if (bitmaps_[i] && bitmaps_[i]->get_framebuffer())
|
| + controller_->RemoveFramebuffer(bitmaps_[i]->get_framebuffer());
|
| + }
|
| }
|
|
|
| bool DriSurface::Initialize() {
|
| @@ -62,6 +69,16 @@ bool DriSurface::Initialize() {
|
| if (!bitmaps_[i]->Initialize()) {
|
| return false;
|
| }
|
| +
|
| + uint32_t framebuffer = 0;
|
| + if (!controller_->AddFramebuffer(bitmaps_[i]->GetColorDepth(),
|
| + bitmaps_[i]->bytesPerPixel() << 3,
|
| + bitmaps_[i]->rowBytes(),
|
| + bitmaps_[i]->get_handle(),
|
| + &framebuffer)) {
|
| + return false;
|
| + }
|
| + bitmaps_[i]->set_framebuffer(framebuffer);
|
| }
|
|
|
| skia_device_ = skia::AdoptRef(
|
|
|