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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::SCANOUT); | 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())) |
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)) |
584 return false; | 584 return false; |
585 } | 585 } |
586 return true; | 586 return true; |
587 } | 587 } |
588 | 588 |
(...skipping 125 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 |