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() | 21 DRTSurfaceOSMesa() |
22 : GLSurfaceOSMesa(gfx::OSMesaSurfaceFormatRGBA, gfx::Size(1, 1)) {} | 22 : GLSurfaceOSMesa(gfx::OSMesaSurfaceFormatRGBA, gfx::Size(1, 1)) {} |
23 | 23 |
24 // Implement a subset of GLSurface. | 24 // Implement a subset of GLSurface. |
25 virtual bool SwapBuffers() OVERRIDE; | 25 virtual bool SwapBuffers() override; |
26 | 26 |
27 private: | 27 private: |
28 virtual ~DRTSurfaceOSMesa() {} | 28 virtual ~DRTSurfaceOSMesa() {} |
29 DISALLOW_COPY_AND_ASSIGN(DRTSurfaceOSMesa); | 29 DISALLOW_COPY_AND_ASSIGN(DRTSurfaceOSMesa); |
30 }; | 30 }; |
31 | 31 |
32 bool DRTSurfaceOSMesa::SwapBuffers() { | 32 bool DRTSurfaceOSMesa::SwapBuffers() { |
33 return true; | 33 return true; |
34 } | 34 } |
35 | 35 |
(...skipping 29 matching lines...) Expand all Loading... |
65 manager, stub, surface.get())); | 65 manager, stub, surface.get())); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 // static | 69 // static |
70 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { | 70 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { |
71 g_allow_os_mesa = allow; | 71 g_allow_os_mesa = allow; |
72 } | 72 } |
73 | 73 |
74 } // namespace content | 74 } // namespace content |
OLD | NEW |