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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 } | 535 } |
536 | 536 |
537 bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() { | 537 bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() { |
538 if (!fbo_) | 538 if (!fbo_) |
539 return true; | 539 return true; |
540 for (size_t i = 0; i < arraysize(textures_); i++) { | 540 for (size_t i = 0; i < arraysize(textures_); i++) { |
541 scoped_refptr<ui::NativePixmap> pixmap = | 541 scoped_refptr<ui::NativePixmap> pixmap = |
542 ui::OzonePlatform::GetInstance() | 542 ui::OzonePlatform::GetInstance() |
543 ->GetSurfaceFactoryOzone() | 543 ->GetSurfaceFactoryOzone() |
544 ->CreateNativePixmap(widget_, GetSize(), | 544 ->CreateNativePixmap(widget_, GetSize(), |
545 ui::SurfaceFactoryOzone::BGRA_8888, | 545 gfx::BufferFormat::BGRA_8888, |
546 ui::SurfaceFactoryOzone::SCANOUT); | 546 gfx::BufferUsage::SCANOUT); |
547 if (!pixmap) | 547 if (!pixmap) |
548 return false; | 548 return false; |
549 scoped_refptr<GLImageOzoneNativePixmap> image = | 549 scoped_refptr<GLImageOzoneNativePixmap> image = |
550 new GLImageOzoneNativePixmap(GetSize(), GL_BGRA_EXT); | 550 new GLImageOzoneNativePixmap(GetSize(), GL_BGRA_EXT); |
551 if (!image->Initialize(pixmap.get(), | 551 if (!image->Initialize(pixmap.get(), gfx::BufferFormat::BGRA_8888)) |
552 gfx::GpuMemoryBuffer::Format::BGRA_8888)) | |
553 return false; | 552 return false; |
554 images_[i] = image; | 553 images_[i] = image; |
555 // Bind image to texture. | 554 // Bind image to texture. |
556 ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); | 555 ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); |
557 if (!images_[i]->BindTexImage(GL_TEXTURE_2D)) | 556 if (!images_[i]->BindTexImage(GL_TEXTURE_2D)) |
558 return false; | 557 return false; |
559 } | 558 } |
560 return true; | 559 return true; |
561 } | 560 } |
562 | 561 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 } | 680 } |
682 } | 681 } |
683 | 682 |
684 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 683 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
685 return ui::OzonePlatform::GetInstance() | 684 return ui::OzonePlatform::GetInstance() |
686 ->GetSurfaceFactoryOzone() | 685 ->GetSurfaceFactoryOzone() |
687 ->GetNativeDisplay(); | 686 ->GetNativeDisplay(); |
688 } | 687 } |
689 | 688 |
690 } // namespace gfx | 689 } // namespace gfx |
OLD | NEW |