OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gl/gl_surface.h" | 5 #include "ui/gl/gl_surface.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 textures_[current_surface_], 0); | 573 textures_[current_surface_], 0); |
574 } | 574 } |
575 | 575 |
576 bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() { | 576 bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() { |
577 if (!fbo_) | 577 if (!fbo_) |
578 return true; | 578 return true; |
579 for (size_t i = 0; i < arraysize(textures_); i++) { | 579 for (size_t i = 0; i < arraysize(textures_); i++) { |
580 scoped_refptr<ui::NativePixmap> pixmap = | 580 scoped_refptr<ui::NativePixmap> pixmap = |
581 ui::SurfaceFactoryOzone::GetInstance()->CreateNativePixmap( | 581 ui::SurfaceFactoryOzone::GetInstance()->CreateNativePixmap( |
582 widget_, GetSize(), ui::SurfaceFactoryOzone::BGRA_8888, | 582 widget_, GetSize(), ui::SurfaceFactoryOzone::BGRA_8888, |
583 ui::SurfaceFactoryOzone::SCANOUT); | 583 ui::SurfaceFactoryOzone::SCANOUT, nullptr); |
584 if (!pixmap) | 584 if (!pixmap) |
585 return false; | 585 return false; |
586 scoped_refptr<SurfaceImage> image = | 586 scoped_refptr<SurfaceImage> image = |
587 new SurfaceImage(GetSize(), GL_BGRA_EXT); | 587 new SurfaceImage(GetSize(), GL_BGRA_EXT); |
588 if (!image->Initialize(pixmap, gfx::GpuMemoryBuffer::Format::BGRA_8888)) | 588 if (!image->Initialize(pixmap, gfx::GpuMemoryBuffer::Format::BGRA_8888)) |
589 return false; | 589 return false; |
590 images_[i] = image; | 590 images_[i] = image; |
591 // Bind image to texture. | 591 // Bind image to texture. |
592 ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); | 592 ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); |
593 if (!images_[i]->BindTexImage(GL_TEXTURE_2D)) | 593 if (!images_[i]->BindTexImage(GL_TEXTURE_2D)) |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 NOTREACHED(); | 709 NOTREACHED(); |
710 return NULL; | 710 return NULL; |
711 } | 711 } |
712 } | 712 } |
713 | 713 |
714 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 714 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
715 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 715 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
716 } | 716 } |
717 | 717 |
718 } // namespace gfx | 718 } // namespace gfx |
OLD | NEW |