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

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

Issue 1432963003: [Ozone] Extends the lifetime of VaapiWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | ui/gl/gl_image.h » ('j') | ui/gl/gl_surface_ozone.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <list> 7 #include <list>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 14 matching lines...) Expand all
25 25
26 namespace { 26 namespace {
27 27
28 class GLImageSync : public gl::GLImage { 28 class GLImageSync : public gl::GLImage {
29 public: 29 public:
30 explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer, 30 explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer,
31 const gfx::Size& size); 31 const gfx::Size& size);
32 32
33 // Implement GLImage. 33 // Implement GLImage.
34 void Destroy(bool have_context) override; 34 void Destroy(bool have_context) override;
35 bool IsValid() override;
35 gfx::Size GetSize() override; 36 gfx::Size GetSize() override;
36 unsigned GetInternalFormat() override; 37 unsigned GetInternalFormat() override;
37 bool BindTexImage(unsigned target) override; 38 bool BindTexImage(unsigned target) override;
38 void ReleaseTexImage(unsigned target) override; 39 void ReleaseTexImage(unsigned target) override;
39 bool CopyTexImage(unsigned target) override; 40 bool CopyTexImage(unsigned target) override;
40 bool CopyTexSubImage(unsigned target, 41 bool CopyTexSubImage(unsigned target,
41 const gfx::Point& offset, 42 const gfx::Point& offset,
42 const gfx::Rect& rect) override; 43 const gfx::Rect& rect) override;
43 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 44 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
44 int z_order, 45 int z_order,
(...skipping 22 matching lines...) Expand all
67 } 68 }
68 69
69 GLImageSync::~GLImageSync() { 70 GLImageSync::~GLImageSync() {
70 if (buffer_.get()) 71 if (buffer_.get())
71 buffer_->RemoveClient(this); 72 buffer_->RemoveClient(this);
72 } 73 }
73 74
74 void GLImageSync::Destroy(bool have_context) { 75 void GLImageSync::Destroy(bool have_context) {
75 } 76 }
76 77
78 bool GLImageSync::IsValid() {
79 return true;
80 }
81
77 gfx::Size GLImageSync::GetSize() { 82 gfx::Size GLImageSync::GetSize() {
78 return size_; 83 return size_;
79 } 84 }
80 85
81 unsigned GLImageSync::GetInternalFormat() { 86 unsigned GLImageSync::GetInternalFormat() {
82 return GL_RGBA; 87 return GL_RGBA;
83 } 88 }
84 89
85 bool GLImageSync::BindTexImage(unsigned target) { 90 bool GLImageSync::BindTexImage(unsigned target) {
86 NOTREACHED(); 91 NOTREACHED();
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 return true; 459 return true;
455 } 460 }
456 461
457 bool TextureDefinition::SafeToRenderFrom() const { 462 bool TextureDefinition::SafeToRenderFrom() const {
458 return level_info_.cleared_rect.Contains( 463 return level_info_.cleared_rect.Contains(
459 gfx::Rect(level_info_.width, level_info_.height)); 464 gfx::Rect(level_info_.width, level_info_.height));
460 } 465 }
461 466
462 } // namespace gles2 467 } // namespace gles2
463 } // namespace gpu 468 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gl_image.h » ('j') | ui/gl/gl_surface_ozone.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698