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

Unified Diff: chrome/browser/android/vr_shell/ui_elements/textured_element.cc

Issue 2965413002: Reland of [vr] Ensure that textured elements never draw with a dirty texture (Closed)
Patch Set: Created 3 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 | « chrome/browser/android/vr_shell/ui_elements/textured_element.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/ui_elements/textured_element.cc
diff --git a/chrome/browser/android/vr_shell/ui_elements/textured_element.cc b/chrome/browser/android/vr_shell/ui_elements/textured_element.cc
index e0a7a168f9546b1038c3694e415be72bc2e78a3c..afe2ae824dc6da6300f8d5e8ba66e44a5f0e91f0 100644
--- a/chrome/browser/android/vr_shell/ui_elements/textured_element.cc
+++ b/chrome/browser/android/vr_shell/ui_elements/textured_element.cc
@@ -29,7 +29,7 @@
}
void TexturedElement::UpdateTexture() {
- if (!initialized_ || !GetTexture()->dirty())
+ if (!initialized_ || !GetTexture()->dirty() || !IsVisible())
return;
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(
texture_size_.width(), texture_size_.height());
@@ -50,6 +50,7 @@
gfx::Transform view_proj_matrix) const {
if (!initialized_)
return;
+ DCHECK(!GetTexture()->dirty());
gfx::SizeF drawn_size = GetTexture()->GetDrawnSize();
gfx::RectF copy_rect(0, 0, drawn_size.width() / texture_size_.width(),
drawn_size.height() / texture_size_.height());
@@ -77,4 +78,8 @@
UpdateTexture();
}
+void TexturedElement::OnBeginFrame(const base::TimeTicks& begin_frame_time) {
+ UpdateTexture();
+}
+
} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements/textured_element.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698