OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 #include "content/common/gpu/gpu_channel_manager.h" | 10 #include "content/common/gpu/gpu_channel_manager.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 class ImageTransportSurfaceAndroid | 33 class ImageTransportSurfaceAndroid |
34 : public NullTransportSurface, | 34 : public NullTransportSurface, |
35 public base::SupportsWeakPtr<ImageTransportSurfaceAndroid> { | 35 public base::SupportsWeakPtr<ImageTransportSurfaceAndroid> { |
36 public: | 36 public: |
37 ImageTransportSurfaceAndroid(GpuChannelManager* manager, | 37 ImageTransportSurfaceAndroid(GpuChannelManager* manager, |
38 GpuCommandBufferStub* stub, | 38 GpuCommandBufferStub* stub, |
39 const gfx::GLSurfaceHandle& handle); | 39 const gfx::GLSurfaceHandle& handle); |
40 | 40 |
41 // gfx::GLSurface implementation. | 41 // gfx::GLSurface implementation. |
42 virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; | 42 virtual bool OnMakeCurrent(gfx::GLContext* context) override; |
43 virtual void WakeUpGpu() OVERRIDE; | 43 virtual void WakeUpGpu() override; |
44 | 44 |
45 protected: | 45 protected: |
46 virtual ~ImageTransportSurfaceAndroid(); | 46 virtual ~ImageTransportSurfaceAndroid(); |
47 | 47 |
48 private: | 48 private: |
49 void ScheduleWakeUp(); | 49 void ScheduleWakeUp(); |
50 void DoWakeUpGpu(); | 50 void DoWakeUpGpu(); |
51 | 51 |
52 base::TimeTicks begin_wake_up_time_; | 52 base::TimeTicks begin_wake_up_time_; |
53 }; | 53 }; |
54 | 54 |
55 class DirectSurfaceAndroid : public PassThroughImageTransportSurface { | 55 class DirectSurfaceAndroid : public PassThroughImageTransportSurface { |
56 public: | 56 public: |
57 DirectSurfaceAndroid(GpuChannelManager* manager, | 57 DirectSurfaceAndroid(GpuChannelManager* manager, |
58 GpuCommandBufferStub* stub, | 58 GpuCommandBufferStub* stub, |
59 gfx::GLSurface* surface); | 59 gfx::GLSurface* surface); |
60 | 60 |
61 // gfx::GLSurface implementation. | 61 // gfx::GLSurface implementation. |
62 virtual bool SwapBuffers() OVERRIDE; | 62 virtual bool SwapBuffers() override; |
63 | 63 |
64 protected: | 64 protected: |
65 virtual ~DirectSurfaceAndroid(); | 65 virtual ~DirectSurfaceAndroid(); |
66 | 66 |
67 private: | 67 private: |
68 DISALLOW_COPY_AND_ASSIGN(DirectSurfaceAndroid); | 68 DISALLOW_COPY_AND_ASSIGN(DirectSurfaceAndroid); |
69 }; | 69 }; |
70 | 70 |
71 ImageTransportSurfaceAndroid::ImageTransportSurfaceAndroid( | 71 ImageTransportSurfaceAndroid::ImageTransportSurfaceAndroid( |
72 GpuChannelManager* manager, | 72 GpuChannelManager* manager, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 if (window) | 151 if (window) |
152 ANativeWindow_release(window); | 152 ANativeWindow_release(window); |
153 if (!initialize_success) | 153 if (!initialize_success) |
154 return scoped_refptr<gfx::GLSurface>(); | 154 return scoped_refptr<gfx::GLSurface>(); |
155 | 155 |
156 return scoped_refptr<gfx::GLSurface>( | 156 return scoped_refptr<gfx::GLSurface>( |
157 new DirectSurfaceAndroid(manager, stub, surface.get())); | 157 new DirectSurfaceAndroid(manager, stub, surface.get())); |
158 } | 158 } |
159 | 159 |
160 } // namespace content | 160 } // namespace content |
OLD | NEW |