| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 gfx::SwapResult SwapBuffers() override; | 62 bool SwapBuffers() override; |
| 63 | 63 |
| 64 protected: | 64 protected: |
| 65 ~DirectSurfaceAndroid() override; | 65 ~DirectSurfaceAndroid() override; |
| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 DidAccessGpu(); | 116 DidAccessGpu(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 DirectSurfaceAndroid::DirectSurfaceAndroid(GpuChannelManager* manager, | 119 DirectSurfaceAndroid::DirectSurfaceAndroid(GpuChannelManager* manager, |
| 120 GpuCommandBufferStub* stub, | 120 GpuCommandBufferStub* stub, |
| 121 gfx::GLSurface* surface) | 121 gfx::GLSurface* surface) |
| 122 : PassThroughImageTransportSurface(manager, stub, surface) {} | 122 : PassThroughImageTransportSurface(manager, stub, surface) {} |
| 123 | 123 |
| 124 DirectSurfaceAndroid::~DirectSurfaceAndroid() {} | 124 DirectSurfaceAndroid::~DirectSurfaceAndroid() {} |
| 125 | 125 |
| 126 gfx::SwapResult DirectSurfaceAndroid::SwapBuffers() { | 126 bool DirectSurfaceAndroid::SwapBuffers() { |
| 127 DidAccessGpu(); | 127 DidAccessGpu(); |
| 128 return PassThroughImageTransportSurface::SwapBuffers(); | 128 return PassThroughImageTransportSurface::SwapBuffers(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // anonymous namespace | 131 } // anonymous namespace |
| 132 | 132 |
| 133 // static | 133 // static |
| 134 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateTransportSurface( | 134 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateTransportSurface( |
| 135 GpuChannelManager* manager, | 135 GpuChannelManager* manager, |
| 136 GpuCommandBufferStub* stub, | 136 GpuCommandBufferStub* stub, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 156 if (window) | 156 if (window) |
| 157 ANativeWindow_release(window); | 157 ANativeWindow_release(window); |
| 158 if (!initialize_success) | 158 if (!initialize_success) |
| 159 return scoped_refptr<gfx::GLSurface>(); | 159 return scoped_refptr<gfx::GLSurface>(); |
| 160 | 160 |
| 161 return scoped_refptr<gfx::GLSurface>( | 161 return scoped_refptr<gfx::GLSurface>( |
| 162 new DirectSurfaceAndroid(manager, stub, surface.get())); | 162 new DirectSurfaceAndroid(manager, stub, surface.get())); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace content | 165 } // namespace content |
| OLD | NEW |