| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ | 5 #ifndef CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ |
| 6 #define CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ | 6 #define CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "content/common/gpu/gpu_command_buffer_stub.h" | 10 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| 11 #include "ipc/ipc_listener.h" | 11 #include "ipc/ipc_listener.h" |
| 12 #include "ui/gl/android/surface_texture.h" | 12 #include "ui/gl/android/surface_texture.h" |
| 13 #include "ui/gl/gl_image.h" | 13 #include "ui/gl/gl_image.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Size; | 16 class Size; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class StreamTexture : public gfx::GLImage, | 21 class StreamTexture : public gl::GLImage, |
| 22 public IPC::Listener, | 22 public IPC::Listener, |
| 23 public GpuCommandBufferStub::DestructionObserver { | 23 public GpuCommandBufferStub::DestructionObserver { |
| 24 public: | 24 public: |
| 25 static bool Create(GpuCommandBufferStub* owner_stub, | 25 static bool Create(GpuCommandBufferStub* owner_stub, |
| 26 uint32 client_texture_id, | 26 uint32 client_texture_id, |
| 27 int stream_id); | 27 int stream_id); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 StreamTexture(GpuCommandBufferStub* owner_stub, | 30 StreamTexture(GpuCommandBufferStub* owner_stub, |
| 31 int32 route_id, | 31 int32 route_id, |
| 32 uint32 texture_id); | 32 uint32 texture_id); |
| 33 ~StreamTexture() override; | 33 ~StreamTexture() override; |
| 34 | 34 |
| 35 // gfx::GLImage implementation: | 35 // gl::GLImage implementation: |
| 36 void Destroy(bool have_context) override; | 36 void Destroy(bool have_context) override; |
| 37 gfx::Size GetSize() override; | 37 gfx::Size GetSize() override; |
| 38 unsigned GetInternalFormat() override; | 38 unsigned GetInternalFormat() override; |
| 39 bool BindTexImage(unsigned target) override; | 39 bool BindTexImage(unsigned target) override; |
| 40 void ReleaseTexImage(unsigned target) override; | 40 void ReleaseTexImage(unsigned target) override; |
| 41 bool CopyTexImage(unsigned target) override; | 41 bool CopyTexImage(unsigned target) override; |
| 42 bool CopyTexSubImage(unsigned target, | 42 bool CopyTexSubImage(unsigned target, |
| 43 const gfx::Point& offset, | 43 const gfx::Point& offset, |
| 44 const gfx::Rect& rect) override; | 44 const gfx::Rect& rect) override; |
| 45 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 45 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 bool has_listener_; | 84 bool has_listener_; |
| 85 uint32 texture_id_; | 85 uint32 texture_id_; |
| 86 | 86 |
| 87 base::WeakPtrFactory<StreamTexture> weak_factory_; | 87 base::WeakPtrFactory<StreamTexture> weak_factory_; |
| 88 DISALLOW_COPY_AND_ASSIGN(StreamTexture); | 88 DISALLOW_COPY_AND_ASSIGN(StreamTexture); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace content | 91 } // namespace content |
| 92 | 92 |
| 93 #endif // CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ | 93 #endif // CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ |
| OLD | NEW |