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

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, 1 month 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 19 matching lines...) Expand all
30 namespace { 30 namespace {
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 gfx::Size GetSize() override; 38 gfx::Size GetSize() override;
39 unsigned GetInternalFormat() override; 39 unsigned GetInternalFormat() override;
40 bool BindTexImage(unsigned target) override; 40 bool BindTexImage(unsigned target, gl::GLFence* fence) override;
41 void ReleaseTexImage(unsigned target) override; 41 void ReleaseTexImage(unsigned target) override;
42 bool CopyTexImage(unsigned target) override; 42 bool CopyTexImage(unsigned target) override;
43 bool CopyTexSubImage(unsigned target, 43 bool CopyTexSubImage(unsigned target,
44 const gfx::Point& offset, 44 const gfx::Point& offset,
45 const gfx::Rect& rect) override; 45 const gfx::Rect& rect) override;
46 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 46 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
47 int z_order, 47 int z_order,
48 gfx::OverlayTransform transform, 48 gfx::OverlayTransform transform,
49 const gfx::Rect& bounds_rect, 49 const gfx::Rect& bounds_rect,
50 const gfx::RectF& crop_rect) override; 50 const gfx::RectF& crop_rect) override;
(...skipping 25 matching lines...) Expand all
76 } 76 }
77 77
78 gfx::Size GLImageSync::GetSize() { 78 gfx::Size GLImageSync::GetSize() {
79 return size_; 79 return size_;
80 } 80 }
81 81
82 unsigned GLImageSync::GetInternalFormat() { 82 unsigned GLImageSync::GetInternalFormat() {
83 return GL_RGBA; 83 return GL_RGBA;
84 } 84 }
85 85
86 bool GLImageSync::BindTexImage(unsigned target) { 86 bool GLImageSync::BindTexImage(unsigned target, gl::GLFence* fence) {
87 NOTREACHED(); 87 NOTREACHED();
88 return false; 88 return false;
89 } 89 }
90 90
91 void GLImageSync::ReleaseTexImage(unsigned target) { 91 void GLImageSync::ReleaseTexImage(unsigned target) {
92 NOTREACHED(); 92 NOTREACHED();
93 } 93 }
94 94
95 bool GLImageSync::CopyTexImage(unsigned target) { 95 bool GLImageSync::CopyTexImage(unsigned target) {
96 return false; 96 return false;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 return true; 461 return true;
462 } 462 }
463 463
464 bool TextureDefinition::SafeToRenderFrom() const { 464 bool TextureDefinition::SafeToRenderFrom() const {
465 return level_info_.cleared_rect.Contains( 465 return level_info_.cleared_rect.Contains(
466 gfx::Rect(level_info_.width, level_info_.height)); 466 gfx::Rect(level_info_.width, level_info_.height));
467 } 467 }
468 468
469 } // namespace gles2 469 } // namespace gles2
470 } // namespace gpu 470 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698