| 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 "content/common/gpu/image_transport_surface.h" | 5 #include "content/common/gpu/image_transport_surface.h" |
| 6 | 6 |
| 7 #include "content/common/gpu/gpu_messages.h" | 7 #include "content/common/gpu/gpu_messages.h" |
| 8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
| 9 #include "ui/gl/gl_context.h" | 9 #include "ui/gl/gl_context.h" |
| 10 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // A subclass of GLSurfaceOSMesa that doesn't print an error message when | 22 // A subclass of GLSurfaceOSMesa that doesn't print an error message when |
| 23 // SwapBuffers() is called. | 23 // SwapBuffers() is called. |
| 24 class DRTSurfaceOSMesa : public gfx::GLSurfaceOSMesa { | 24 class DRTSurfaceOSMesa : public gfx::GLSurfaceOSMesa { |
| 25 public: | 25 public: |
| 26 // Size doesn't matter, the surface is resized to the right size later. | 26 // Size doesn't matter, the surface is resized to the right size later. |
| 27 DRTSurfaceOSMesa() | 27 DRTSurfaceOSMesa() |
| 28 : GLSurfaceOSMesa(gfx::OSMesaSurfaceFormatRGBA, gfx::Size(1, 1)) {} | 28 : GLSurfaceOSMesa(gfx::OSMesaSurfaceFormatRGBA, gfx::Size(1, 1)) {} |
| 29 | 29 |
| 30 // Implement a subset of GLSurface. | 30 // Implement a subset of GLSurface. |
| 31 gfx::SwapResult SwapBuffers() override; | 31 bool SwapBuffers() override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 ~DRTSurfaceOSMesa() override {} | 34 ~DRTSurfaceOSMesa() override {} |
| 35 DISALLOW_COPY_AND_ASSIGN(DRTSurfaceOSMesa); | 35 DISALLOW_COPY_AND_ASSIGN(DRTSurfaceOSMesa); |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 gfx::SwapResult DRTSurfaceOSMesa::SwapBuffers() { | 38 bool DRTSurfaceOSMesa::SwapBuffers() { |
| 39 return gfx::SwapResult::SWAP_ACK; | 39 return true; |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool g_allow_os_mesa = false; | 42 bool g_allow_os_mesa = false; |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 // static | 46 // static |
| 47 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( | 47 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( |
| 48 GpuChannelManager* manager, | 48 GpuChannelManager* manager, |
| 49 GpuCommandBufferStub* stub, | 49 GpuCommandBufferStub* stub, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 manager, stub, surface.get())); | 72 manager, stub, surface.get())); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 // static | 76 // static |
| 77 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { | 77 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { |
| 78 g_allow_os_mesa = allow; | 78 g_allow_os_mesa = allow; |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace content | 81 } // namespace content |
| OLD | NEW |