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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2820643002: Decouple some graphics-related IsLowEndDevice() policies for 1GB devices. (Closed)
Patch Set: Rebase 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 | content/renderer/gpu/render_widget_compositor.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 gpu::gles2::ContextCreationAttribHelper attributes; 162 gpu::gles2::ContextCreationAttribHelper attributes;
163 attributes.alpha_size = -1; 163 attributes.alpha_size = -1;
164 attributes.stencil_size = 0; 164 attributes.stencil_size = 0;
165 attributes.depth_size = 0; 165 attributes.depth_size = 0;
166 attributes.samples = 0; 166 attributes.samples = 0;
167 attributes.sample_buffers = 0; 167 attributes.sample_buffers = 0;
168 attributes.bind_generates_resource = false; 168 attributes.bind_generates_resource = false;
169 169
170 if (has_transparent_background) { 170 if (has_transparent_background) {
171 attributes.alpha_size = 8; 171 attributes.alpha_size = 8;
172 } else if (base::SysInfo::IsLowEndDevice()) { 172 } else if (base::SysInfo::AmountOfPhysicalMemoryMB() <= 512) {
173 // In this case we prefer to use RGB565 format instead of RGBA8888 if 173 // In this case we prefer to use RGB565 format instead of RGBA8888 if
174 // possible. 174 // possible.
175 // TODO(danakj): GpuCommandBufferStub constructor checks for alpha == 0 in 175 // TODO(danakj): GpuCommandBufferStub constructor checks for alpha == 0 in
176 // order to enable 565, but it should avoid using 565 when -1s are 176 // order to enable 565, but it should avoid using 565 when -1s are
177 // specified 177 // specified
178 // (IOW check that a <= 0 && rgb > 0 && rgb <= 565) then alpha should be 178 // (IOW check that a <= 0 && rgb > 0 && rgb <= 565) then alpha should be
179 // -1. 179 // -1.
180 // TODO(liberato): This condition is memorized in ComositorView.java, to 180 // TODO(liberato): This condition is memorized in ComositorView.java, to
181 // avoid using two surfaces temporarily during alpha <-> no alpha 181 // avoid using two surfaces temporarily during alpha <-> no alpha
182 // transitions. If these mismatch, then we risk a power regression if the 182 // transitions. If these mismatch, then we risk a power regression if the
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 } 869 }
870 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, 870 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_,
871 frame_sink_id); 871 frame_sink_id);
872 } 872 }
873 873
874 bool CompositorImpl::HavePendingReadbacks() { 874 bool CompositorImpl::HavePendingReadbacks() {
875 return !readback_layer_tree_->children().empty(); 875 return !readback_layer_tree_->children().empty();
876 } 876 }
877 877
878 } // namespace content 878 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698