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