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 #include "ui/gl/gl_image_egl.h" | 5 #include "ui/gl/gl_image_egl.h" |
6 | 6 |
7 #include "ui/gl/gl_bindings.h" | 7 #include "ui/gl/gl_bindings.h" |
8 #include "ui/gl/gl_surface_egl.h" | 8 #include "ui/gl/gl_surface_egl.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 gfx::Size GLImageEGL::GetSize() { | 61 gfx::Size GLImageEGL::GetSize() { |
62 return size_; | 62 return size_; |
63 } | 63 } |
64 | 64 |
65 bool GLImageEGL::BindTexImage(unsigned target) { | 65 bool GLImageEGL::BindTexImage(unsigned target) { |
66 if (egl_image_ == EGL_NO_IMAGE_KHR) { | 66 if (egl_image_ == EGL_NO_IMAGE_KHR) { |
67 LOG(ERROR) << "NULL EGLImage in BindTexImage"; | 67 LOG(ERROR) << "NULL EGLImage in BindTexImage"; |
68 return false; | 68 return false; |
69 } | 69 } |
70 | 70 |
| 71 if (target == GL_TEXTURE_RECTANGLE_ARB) { |
| 72 LOG(ERROR) << "EGLImage cannot be bound to TEXTURE_RECTANGLE_ARB target"; |
| 73 return false; |
| 74 } |
| 75 |
71 if (target_ && target_ != target) { | 76 if (target_ && target_ != target) { |
72 LOG(ERROR) << "EGLImage can only be bound to one target"; | 77 LOG(ERROR) << "EGLImage can only be bound to one target"; |
73 return false; | 78 return false; |
74 } | 79 } |
75 target_ = target; | 80 target_ = target; |
76 | 81 |
77 // Defer ImageTargetTexture2D if not currently in use. | 82 // Defer ImageTargetTexture2D if not currently in use. |
78 if (!in_use_) | 83 if (!in_use_) |
79 return true; | 84 return true; |
80 | 85 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 GL_RGBA, | 118 GL_RGBA, |
114 GL_UNSIGNED_BYTE, | 119 GL_UNSIGNED_BYTE, |
115 &zero); | 120 &zero); |
116 } | 121 } |
117 | 122 |
118 void GLImageEGL::SetReleaseAfterUse() { | 123 void GLImageEGL::SetReleaseAfterUse() { |
119 release_after_use_ = true; | 124 release_after_use_ = true; |
120 } | 125 } |
121 | 126 |
122 } // namespace gfx | 127 } // namespace gfx |
OLD | NEW |