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

Side by Side Diff: gpu/ipc/service/stream_texture_android.cc

Issue 2208733002: Command buffer: clear rect for a specific layer/level of the uncleared texture for CopyTexSubImage3D (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not assign a default value 0 to layer, UpdateMipCleared for all layers for 3D texture Created 4 years, 4 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 (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 "gpu/ipc/service/stream_texture_android.h" 5 #include "gpu/ipc/service/stream_texture_android.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/stringize_macros.h" 10 #include "base/strings/stringize_macros.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // TODO: Ideally a valid image id was returned to the client so that 43 // TODO: Ideally a valid image id was returned to the client so that
44 // it could then call glBindTexImage2D() for doing the following. 44 // it could then call glBindTexImage2D() for doing the following.
45 scoped_refptr<gpu::gles2::GLStreamTextureImage> gl_image( 45 scoped_refptr<gpu::gles2::GLStreamTextureImage> gl_image(
46 new StreamTexture(owner_stub, stream_id, texture->service_id())); 46 new StreamTexture(owner_stub, stream_id, texture->service_id()));
47 gfx::Size size = gl_image->GetSize(); 47 gfx::Size size = gl_image->GetSize();
48 texture_manager->SetTarget(texture, GL_TEXTURE_EXTERNAL_OES); 48 texture_manager->SetTarget(texture, GL_TEXTURE_EXTERNAL_OES);
49 texture_manager->SetLevelInfo(texture, GL_TEXTURE_EXTERNAL_OES, 0, GL_RGBA, 49 texture_manager->SetLevelInfo(texture, GL_TEXTURE_EXTERNAL_OES, 0, GL_RGBA,
50 size.width(), size.height(), 1, 0, GL_RGBA, 50 size.width(), size.height(), 1, 0, GL_RGBA,
51 GL_UNSIGNED_BYTE, gfx::Rect(size)); 51 GL_UNSIGNED_BYTE, gfx::Rect(size));
52 texture_manager->SetLevelStreamTextureImage( 52 texture_manager->SetLevelStreamTextureImage(
53 texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image.get(), 53 texture, GL_TEXTURE_EXTERNAL_OES, 0, 0, gl_image.get(),
54 gles2::Texture::UNBOUND, 0); 54 gles2::Texture::UNBOUND, 0);
55 return true; 55 return true;
56 } 56 }
57 57
58 return false; 58 return false;
59 } 59 }
60 60
61 StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub, 61 StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub,
62 int32_t route_id, 62 int32_t route_id,
63 uint32_t texture_id) 63 uint32_t texture_id)
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 UpdateTexImage(); 191 UpdateTexImage();
192 192
193 TextureManager* texture_manager = 193 TextureManager* texture_manager =
194 owner_stub_->decoder()->GetContextGroup()->texture_manager(); 194 owner_stub_->decoder()->GetContextGroup()->texture_manager();
195 gles2::Texture* texture = 195 gles2::Texture* texture =
196 texture_manager->GetTextureForServiceId(texture_id_); 196 texture_manager->GetTextureForServiceId(texture_id_);
197 if (texture) { 197 if (texture) {
198 // By setting image state to UNBOUND instead of COPIED we ensure that 198 // By setting image state to UNBOUND instead of COPIED we ensure that
199 // CopyTexImage() is called each time the surface texture is used for 199 // CopyTexImage() is called each time the surface texture is used for
200 // drawing. 200 // drawing.
201 texture->SetLevelStreamTextureImage(GL_TEXTURE_EXTERNAL_OES, 0, this, 201 texture->SetLevelStreamTextureImage(GL_TEXTURE_EXTERNAL_OES, 0, 0, this,
202 gles2::Texture::UNBOUND, 0); 202 gles2::Texture::UNBOUND, 0);
203 } 203 }
204 204
205 return true; 205 return true;
206 } 206 }
207 207
208 void StreamTexture::OnFrameAvailable() { 208 void StreamTexture::OnFrameAvailable() {
209 has_pending_frame_ = true; 209 has_pending_frame_ = true;
210 if (has_listener_ && owner_stub_) { 210 if (has_listener_ && owner_stub_) {
211 owner_stub_->channel()->Send( 211 owner_stub_->channel()->Send(
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 return false; 273 return false;
274 } 274 }
275 275
276 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, 276 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
277 uint64_t process_tracing_id, 277 uint64_t process_tracing_id,
278 const std::string& dump_name) { 278 const std::string& dump_name) {
279 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914 279 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914
280 } 280 }
281 281
282 } // namespace gpu 282 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager_unittest.cc ('k') | media/gpu/android_deferred_rendering_backing_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698