| 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 "gpu/command_buffer/service/texture_definition.h" | 5 #include "gpu/command_buffer/service/texture_definition.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 const gfx::Point& offset, | 47 const gfx::Point& offset, |
| 48 const gfx::Rect& rect) override; | 48 const gfx::Rect& rect) override; |
| 49 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 49 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
| 50 int z_order, | 50 int z_order, |
| 51 gfx::OverlayTransform transform, | 51 gfx::OverlayTransform transform, |
| 52 const gfx::Rect& bounds_rect, | 52 const gfx::Rect& bounds_rect, |
| 53 const gfx::RectF& crop_rect) override; | 53 const gfx::RectF& crop_rect) override; |
| 54 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 54 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
| 55 uint64_t process_tracing_id, | 55 uint64_t process_tracing_id, |
| 56 const std::string& dump_name) override; | 56 const std::string& dump_name) override; |
| 57 bool EmulatingRGB() const override; |
| 57 | 58 |
| 58 protected: | 59 protected: |
| 59 ~GLImageSync() override; | 60 ~GLImageSync() override; |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 scoped_refptr<NativeImageBuffer> buffer_; | 63 scoped_refptr<NativeImageBuffer> buffer_; |
| 63 gfx::Size size_; | 64 gfx::Size size_; |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(GLImageSync); | 66 DISALLOW_COPY_AND_ASSIGN(GLImageSync); |
| 66 }; | 67 }; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 NOTREACHED(); | 116 NOTREACHED(); |
| 116 return false; | 117 return false; |
| 117 } | 118 } |
| 118 | 119 |
| 119 void GLImageSync::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 120 void GLImageSync::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
| 120 uint64_t process_tracing_id, | 121 uint64_t process_tracing_id, |
| 121 const std::string& dump_name) { | 122 const std::string& dump_name) { |
| 122 // TODO(ericrk): Implement GLImage OnMemoryDump. crbug.com/514914 | 123 // TODO(ericrk): Implement GLImage OnMemoryDump. crbug.com/514914 |
| 123 } | 124 } |
| 124 | 125 |
| 126 bool GLImageSync::EmulatingRGB() const { |
| 127 return false; |
| 128 } |
| 129 |
| 125 #if !defined(OS_MACOSX) | 130 #if !defined(OS_MACOSX) |
| 126 class NativeImageBufferEGL : public NativeImageBuffer { | 131 class NativeImageBufferEGL : public NativeImageBuffer { |
| 127 public: | 132 public: |
| 128 static scoped_refptr<NativeImageBufferEGL> Create(GLuint texture_id); | 133 static scoped_refptr<NativeImageBufferEGL> Create(GLuint texture_id); |
| 129 | 134 |
| 130 private: | 135 private: |
| 131 NativeImageBufferEGL(EGLDisplay display, EGLImageKHR image); | 136 NativeImageBufferEGL(EGLDisplay display, EGLImageKHR image); |
| 132 ~NativeImageBufferEGL() override; | 137 ~NativeImageBufferEGL() override; |
| 133 void AddClient(gl::GLImage* client) override; | 138 void AddClient(gl::GLImage* client) override; |
| 134 void RemoveClient(gl::GLImage* client) override; | 139 void RemoveClient(gl::GLImage* client) override; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 return true; | 471 return true; |
| 467 } | 472 } |
| 468 | 473 |
| 469 bool TextureDefinition::SafeToRenderFrom() const { | 474 bool TextureDefinition::SafeToRenderFrom() const { |
| 470 return level_info_.cleared_rect.Contains( | 475 return level_info_.cleared_rect.Contains( |
| 471 gfx::Rect(level_info_.width, level_info_.height)); | 476 gfx::Rect(level_info_.width, level_info_.height)); |
| 472 } | 477 } |
| 473 | 478 |
| 474 } // namespace gles2 | 479 } // namespace gles2 |
| 475 } // namespace gpu | 480 } // namespace gpu |
| OLD | NEW |