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

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

Issue 2145643004: Fix preserve backbuffer with native GMBs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | gpu/command_buffer/tests/gl_manager.h » ('j') | 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 6df7f6a2f816a89bb6e37149101e0a60c27a2da4..82fa88ec9504107627eadeee5a284c23a399ca86 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -402,7 +402,7 @@ class BackTexture {
bool AllocateStorage(const gfx::Size& size, GLenum format, bool zero);
// Copy the contents of the currently bound frame buffer.
- void Copy(const gfx::Size& size, GLenum format);
+ void Copy();
// Destroy the render texture. This must be explicitly called before
// destroying this object.
@@ -2592,15 +2592,14 @@ bool BackTexture::AllocateStorage(
return success;
}
-void BackTexture::Copy(const gfx::Size& size, GLenum format) {
+void BackTexture::Copy() {
DCHECK_NE(id(), 0u);
ScopedGLErrorSuppressor suppressor("BackTexture::Copy",
decoder_->state_.GetErrorState());
ScopedTextureBinder binder(&decoder_->state_, id(), Target());
- glCopyTexImage2D(Target(),
- 0, // level
- format, 0, 0, size.width(), size.height(),
- 0); // border
+ glCopyTexSubImage2D(Target(),
+ 0, // level
+ 0, 0, 0, 0, size_.width(), size_.height());
}
void BackTexture::Destroy() {
@@ -13479,9 +13478,7 @@ void GLES2DecoderImpl::DoSwapBuffers() {
if (offscreen_target_buffer_preserved_) {
// Copy the target frame buffer to the saved offscreen texture.
- offscreen_saved_color_texture_->Copy(
- offscreen_saved_color_texture_->size(),
- offscreen_saved_color_format_);
+ offscreen_saved_color_texture_->Copy();
} else {
offscreen_saved_color_texture_.swap(offscreen_target_color_texture_);
offscreen_target_frame_buffer_->AttachRenderTexture(
« no previous file with comments | « no previous file | gpu/command_buffer/tests/gl_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698