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_fbo_mac.h" | 5 #include "content/common/gpu/image_transport_surface_fbo_mac.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" |
11 #include "ui/gl/gl_surface_osmesa.h" | 11 #include "ui/gl/gl_surface_osmesa.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 namespace { | 14 namespace { |
15 | 15 |
16 // A subclass of GLSurfaceOSMesa that doesn't print an error message when | 16 // A subclass of GLSurfaceOSMesa that doesn't print an error message when |
17 // SwapBuffers() is called. | 17 // SwapBuffers() is called. |
18 class DRTSurfaceOSMesa : public gfx::GLSurfaceOSMesa { | 18 class DRTSurfaceOSMesa : public gfx::GLSurfaceOSMesa { |
19 public: | 19 public: |
20 // Size doesn't matter, the surface is resized to the right size later. | 20 // Size doesn't matter, the surface is resized to the right size later. |
21 DRTSurfaceOSMesa() : GLSurfaceOSMesa(GL_RGBA, gfx::Size(1, 1)) {} | 21 DRTSurfaceOSMesa() |
| 22 : GLSurfaceOSMesa(gfx::OSMesaSurfaceFormatRGBA, gfx::Size(1, 1)) {} |
22 | 23 |
23 // Implement a subset of GLSurface. | 24 // Implement a subset of GLSurface. |
24 virtual bool SwapBuffers() OVERRIDE; | 25 virtual bool SwapBuffers() OVERRIDE; |
25 | 26 |
26 private: | 27 private: |
27 virtual ~DRTSurfaceOSMesa() {} | 28 virtual ~DRTSurfaceOSMesa() {} |
28 DISALLOW_COPY_AND_ASSIGN(DRTSurfaceOSMesa); | 29 DISALLOW_COPY_AND_ASSIGN(DRTSurfaceOSMesa); |
29 }; | 30 }; |
30 | 31 |
31 bool DRTSurfaceOSMesa::SwapBuffers() { | 32 bool DRTSurfaceOSMesa::SwapBuffers() { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 manager, stub, surface.get())); | 65 manager, stub, surface.get())); |
65 } | 66 } |
66 } | 67 } |
67 | 68 |
68 // static | 69 // static |
69 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { | 70 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { |
70 g_allow_os_mesa = allow; | 71 g_allow_os_mesa = allow; |
71 } | 72 } |
72 | 73 |
73 } // namespace content | 74 } // namespace content |
OLD | NEW |