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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 954053002: gpu: Avoid detaching images with glTexSubImage2D (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 6b254e0966bb8ad2de4ee746bf53e6f7cb3dc269..58a73597e541a4adeead8a33dea305a53996fc3b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -8490,10 +8490,13 @@ bool GLES2DecoderImpl::ClearLevel(
memset(zero.get(), 0, size);
glBindTexture(bind_target, service_id);
+ Texture* clear_texture =
+ texture_manager()->GetTextureForServiceId(service_id);
no sievers 2015/02/25 01:23:27 Can you change it instead to pass in texture? And
+ bool has_images = clear_texture && clear_texture->HasImages();
GLint y = 0;
while (y < height) {
GLint h = y + tile_height > height ? height - y : tile_height;
- if (is_texture_immutable || h != height) {
+ if (is_texture_immutable || h != height || has_images) {
glTexSubImage2D(target, level, 0, y, width, h, format, type, zero.get());
} else {
glTexImage2D(
@@ -9441,7 +9444,8 @@ error::Error GLES2DecoderImpl::DoTexSubImage2D(
}
if (!texture_state_.texsubimage2d_faster_than_teximage2d &&
- !texture->IsImmutable()) {
+ !texture->IsImmutable() &&
+ !texture->HasImages()) {
ScopedTextureUploadTimer timer(&texture_state_);
GLenum internal_format;
GLenum tex_type;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698