Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: ui/gl/gl_surface_ozone.cc

Issue 1128113011: ozone: Introduce ClientPixmap and ClientPixmapFactory for non-GPU processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed nits Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 ui::NATIVE_PIXMAP_FORMAT_BGRA_8888,
546 ui::SurfaceFactoryOzone::SCANOUT); 546 ui::NATIVE_PIXMAP_USAGE_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(),
552 gfx::GpuMemoryBuffer::Format::BGRA_8888)) 552 gfx::GpuMemoryBuffer::Format::BGRA_8888))
553 return false; 553 return false;
554 images_[i] = image; 554 images_[i] = image;
555 // Bind image to texture. 555 // Bind image to texture.
556 ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); 556 ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 } 681 }
682 } 682 }
683 683
684 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 684 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
685 return ui::OzonePlatform::GetInstance() 685 return ui::OzonePlatform::GetInstance()
686 ->GetSurfaceFactoryOzone() 686 ->GetSurfaceFactoryOzone()
687 ->GetNativeDisplay(); 687 ->GetNativeDisplay();
688 } 688 }
689 689
690 } // namespace gfx 690 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698