| 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 563 |
| 564 bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() { | 564 bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() { |
| 565 if (!fbo_) | 565 if (!fbo_) |
| 566 return true; | 566 return true; |
| 567 for (size_t i = 0; i < arraysize(textures_); i++) { | 567 for (size_t i = 0; i < arraysize(textures_); i++) { |
| 568 scoped_refptr<ui::NativePixmap> pixmap = | 568 scoped_refptr<ui::NativePixmap> pixmap = |
| 569 ui::OzonePlatform::GetInstance() | 569 ui::OzonePlatform::GetInstance() |
| 570 ->GetSurfaceFactoryOzone() | 570 ->GetSurfaceFactoryOzone() |
| 571 ->CreateNativePixmap(widget_, GetSize(), | 571 ->CreateNativePixmap(widget_, GetSize(), |
| 572 gfx::BufferFormat::BGRA_8888, | 572 gfx::BufferFormat::BGRA_8888, |
| 573 gfx::BufferUsage::GPU_READ_WRITE); | 573 gfx::BufferUsage::SCANOUT); |
| 574 if (!pixmap) | 574 if (!pixmap) |
| 575 return false; | 575 return false; |
| 576 scoped_refptr<GLImageOzoneNativePixmap> image = | 576 scoped_refptr<GLImageOzoneNativePixmap> image = |
| 577 new GLImageOzoneNativePixmap(GetSize(), GL_BGRA_EXT); | 577 new GLImageOzoneNativePixmap(GetSize(), GL_BGRA_EXT); |
| 578 if (!image->Initialize(pixmap.get(), gfx::BufferFormat::BGRA_8888)) | 578 if (!image->Initialize(pixmap.get(), gfx::BufferFormat::BGRA_8888)) |
| 579 return false; | 579 return false; |
| 580 images_[i] = image; | 580 images_[i] = image; |
| 581 // Bind image to texture. | 581 // Bind image to texture. |
| 582 ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); | 582 ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); |
| 583 if (!images_[i]->BindTexImage(GL_TEXTURE_2D)) | 583 if (!images_[i]->BindTexImage(GL_TEXTURE_2D)) |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 } | 714 } |
| 715 } | 715 } |
| 716 | 716 |
| 717 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 717 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
| 718 return ui::OzonePlatform::GetInstance() | 718 return ui::OzonePlatform::GetInstance() |
| 719 ->GetSurfaceFactoryOzone() | 719 ->GetSurfaceFactoryOzone() |
| 720 ->GetNativeDisplay(); | 720 ->GetNativeDisplay(); |
| 721 } | 721 } |
| 722 | 722 |
| 723 } // namespace gfx | 723 } // namespace gfx |
| OLD | NEW |