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

Side by Side Diff: chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc

Issue 2833823002: WebVR: Add explicit precision to all shaders to avoid Mali GPU crash (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "chrome/browser/android/vr_shell/mailbox_to_surface_bridge.h" 5 #include "chrome/browser/android/vr_shell/mailbox_to_surface_bridge.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 12 matching lines...) Expand all
23 23
24 #include <android/native_window_jni.h> 24 #include <android/native_window_jni.h>
25 25
26 #define VOID_OFFSET(x) reinterpret_cast<void*>(x) 26 #define VOID_OFFSET(x) reinterpret_cast<void*>(x)
27 #define SHADER(Src) #Src 27 #define SHADER(Src) #Src
28 28
29 namespace { 29 namespace {
30 30
31 /* clang-format off */ 31 /* clang-format off */
32 const char kQuadCopyVertex[] = SHADER( 32 const char kQuadCopyVertex[] = SHADER(
33 precision mediump float;
33 attribute vec4 a_Position; 34 attribute vec4 a_Position;
34 attribute vec2 a_TexCoordinate; 35 attribute vec2 a_TexCoordinate;
35 varying vec2 v_TexCoordinate; 36 varying highp vec2 v_TexCoordinate;
36 void main() { 37 void main() {
37 v_TexCoordinate = a_TexCoordinate; 38 v_TexCoordinate = a_TexCoordinate;
38 gl_Position = a_Position; 39 gl_Position = a_Position;
39 } 40 }
40 ); 41 );
41 42
42 const char kQuadCopyFragment[] = SHADER( 43 const char kQuadCopyFragment[] = SHADER(
43 precision highp float; 44 precision highp float;
44 uniform sampler2D u_Texture; 45 uniform sampler2D u_Texture;
45 varying vec2 v_TexCoordinate; 46 varying vec2 v_TexCoordinate;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // GL_NEAREST. 338 // GL_NEAREST.
338 gl_->BindTexture(GL_TEXTURE_2D, texture_handle); 339 gl_->BindTexture(GL_TEXTURE_2D, texture_handle);
339 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 340 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
340 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 341 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
341 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 342 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
342 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 343 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
343 gl_->DrawArrays(GL_TRIANGLE_FAN, 0, 4); 344 gl_->DrawArrays(GL_TRIANGLE_FAN, 0, 4);
344 } 345 }
345 346
346 } // namespace vr_shell 347 } // namespace vr_shell
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698