Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: gpu/command_buffer/service/texture_definition.cc

Issue 2388653002: gpu: Add CHROMIUM_texture_from_image spec and fence support.
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 20 matching lines...) Expand all
31 31
32 class GLImageSync : public gl::GLImage { 32 class GLImageSync : public gl::GLImage {
33 public: 33 public:
34 explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer, 34 explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer,
35 const gfx::Size& size); 35 const gfx::Size& size);
36 36
37 // Implement GLImage. 37 // Implement GLImage.
38 void Destroy(bool have_context) override; 38 void Destroy(bool have_context) override;
39 gfx::Size GetSize() override; 39 gfx::Size GetSize() override;
40 unsigned GetInternalFormat() override; 40 unsigned GetInternalFormat() override;
41 bool BindTexImage(unsigned target) override; 41 bool BindTexImage(unsigned target, gl::GLFence* fence) override;
42 void ReleaseTexImage(unsigned target) override; 42 void ReleaseTexImage(unsigned target) override;
43 bool CopyTexImage(unsigned target) override; 43 bool CopyTexImage(unsigned target) override;
44 bool CopyTexSubImage(unsigned target, 44 bool CopyTexSubImage(unsigned target,
45 const gfx::Point& offset, 45 const gfx::Point& offset,
46 const gfx::Rect& rect) override; 46 const gfx::Rect& rect) override;
47 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 47 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
48 int z_order, 48 int z_order,
49 gfx::OverlayTransform transform, 49 gfx::OverlayTransform transform,
50 const gfx::Rect& bounds_rect, 50 const gfx::Rect& bounds_rect,
51 const gfx::RectF& crop_rect) override; 51 const gfx::RectF& crop_rect) override;
(...skipping 28 matching lines...) Expand all
80 } 80 }
81 81
82 gfx::Size GLImageSync::GetSize() { 82 gfx::Size GLImageSync::GetSize() {
83 return size_; 83 return size_;
84 } 84 }
85 85
86 unsigned GLImageSync::GetInternalFormat() { 86 unsigned GLImageSync::GetInternalFormat() {
87 return GL_RGBA; 87 return GL_RGBA;
88 } 88 }
89 89
90 bool GLImageSync::BindTexImage(unsigned target) { 90 bool GLImageSync::BindTexImage(unsigned target, gl::GLFence* fence) {
91 NOTREACHED(); 91 NOTREACHED();
92 return false; 92 return false;
93 } 93 }
94 94
95 void GLImageSync::ReleaseTexImage(unsigned target) { 95 void GLImageSync::ReleaseTexImage(unsigned target) {
96 NOTREACHED(); 96 NOTREACHED();
97 } 97 }
98 98
99 bool GLImageSync::CopyTexImage(unsigned target) { 99 bool GLImageSync::CopyTexImage(unsigned target) {
100 return false; 100 return false;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 return true; 465 return true;
466 } 466 }
467 467
468 bool TextureDefinition::SafeToRenderFrom() const { 468 bool TextureDefinition::SafeToRenderFrom() const {
469 return level_info_.cleared_rect.Contains( 469 return level_info_.cleared_rect.Contains(
470 gfx::Rect(level_info_.width, level_info_.height)); 470 gfx::Rect(level_info_.width, level_info_.height));
471 } 471 }
472 472
473 } // namespace gles2 473 } // namespace gles2
474 } // namespace gpu 474 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698