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

Side by Side Diff: cc/output/renderer_settings.cc

Issue 1713503002: Reland Allow one-copy and zero-copy task tile worker pools to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « cc/output/renderer_settings.h ('k') | cc/output/renderer_settings_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/output/renderer_settings.h" 5 #include "cc/output/renderer_settings.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/proto/renderer_settings.pb.h" 10 #include "cc/proto/renderer_settings.pb.h"
11 #include "cc/resources/platform_color.h"
11 12
12 namespace cc { 13 namespace cc {
13 14
14 RendererSettings::RendererSettings() 15 RendererSettings::RendererSettings()
15 : allow_antialiasing(true), 16 : allow_antialiasing(true),
16 force_antialiasing(false), 17 force_antialiasing(false),
17 force_blending_with_shaders(false), 18 force_blending_with_shaders(false),
18 partial_swap_enabled(false), 19 partial_swap_enabled(false),
19 finish_rendering_on_resize(false), 20 finish_rendering_on_resize(false),
20 should_clear_root_render_pass(true), 21 should_clear_root_render_pass(true),
21 disable_display_vsync(false), 22 disable_display_vsync(false),
22 release_overlay_resources_on_swap_complete(false), 23 release_overlay_resources_on_swap_complete(false),
23 refresh_rate(60.0), 24 refresh_rate(60.0),
24 highp_threshold_min(0), 25 highp_threshold_min(0),
25 use_rgba_4444_textures(false),
26 texture_id_allocation_chunk_size(64), 26 texture_id_allocation_chunk_size(64),
27 use_gpu_memory_buffer_resources(false) {} 27 use_gpu_memory_buffer_resources(false),
28 preferred_tile_format(PlatformColor::BestTextureFormat()) {}
28 29
29 RendererSettings::~RendererSettings() { 30 RendererSettings::~RendererSettings() {
30 } 31 }
31 32
32 void RendererSettings::ToProtobuf(proto::RendererSettings* proto) const { 33 void RendererSettings::ToProtobuf(proto::RendererSettings* proto) const {
33 proto->set_allow_antialiasing(allow_antialiasing); 34 proto->set_allow_antialiasing(allow_antialiasing);
34 proto->set_force_antialiasing(force_antialiasing); 35 proto->set_force_antialiasing(force_antialiasing);
35 proto->set_force_blending_with_shaders(force_blending_with_shaders); 36 proto->set_force_blending_with_shaders(force_blending_with_shaders);
36 proto->set_partial_swap_enabled(partial_swap_enabled); 37 proto->set_partial_swap_enabled(partial_swap_enabled);
37 proto->set_finish_rendering_on_resize(finish_rendering_on_resize); 38 proto->set_finish_rendering_on_resize(finish_rendering_on_resize);
38 proto->set_should_clear_root_render_pass(should_clear_root_render_pass); 39 proto->set_should_clear_root_render_pass(should_clear_root_render_pass);
39 proto->set_disable_display_vsync(disable_display_vsync); 40 proto->set_disable_display_vsync(disable_display_vsync);
40 proto->set_release_overlay_resources_on_swap_complete( 41 proto->set_release_overlay_resources_on_swap_complete(
41 release_overlay_resources_on_swap_complete); 42 release_overlay_resources_on_swap_complete);
42 proto->set_refresh_rate(refresh_rate); 43 proto->set_refresh_rate(refresh_rate);
43 proto->set_highp_threshold_min(highp_threshold_min); 44 proto->set_highp_threshold_min(highp_threshold_min);
44 proto->set_use_rgba_4444_textures(use_rgba_4444_textures);
45 proto->set_texture_id_allocation_chunk_size(texture_id_allocation_chunk_size); 45 proto->set_texture_id_allocation_chunk_size(texture_id_allocation_chunk_size);
46 proto->set_use_gpu_memory_buffer_resources(use_gpu_memory_buffer_resources); 46 proto->set_use_gpu_memory_buffer_resources(use_gpu_memory_buffer_resources);
47 proto->set_preferred_tile_format(preferred_tile_format);
47 } 48 }
48 49
49 void RendererSettings::FromProtobuf(const proto::RendererSettings& proto) { 50 void RendererSettings::FromProtobuf(const proto::RendererSettings& proto) {
50 allow_antialiasing = proto.allow_antialiasing(); 51 allow_antialiasing = proto.allow_antialiasing();
51 force_antialiasing = proto.force_antialiasing(); 52 force_antialiasing = proto.force_antialiasing();
52 force_blending_with_shaders = proto.force_blending_with_shaders(); 53 force_blending_with_shaders = proto.force_blending_with_shaders();
53 partial_swap_enabled = proto.partial_swap_enabled(); 54 partial_swap_enabled = proto.partial_swap_enabled();
54 finish_rendering_on_resize = proto.finish_rendering_on_resize(); 55 finish_rendering_on_resize = proto.finish_rendering_on_resize();
55 should_clear_root_render_pass = proto.should_clear_root_render_pass(); 56 should_clear_root_render_pass = proto.should_clear_root_render_pass();
56 disable_display_vsync = proto.disable_display_vsync(); 57 disable_display_vsync = proto.disable_display_vsync();
57 release_overlay_resources_on_swap_complete = 58 release_overlay_resources_on_swap_complete =
58 proto.release_overlay_resources_on_swap_complete(); 59 proto.release_overlay_resources_on_swap_complete();
59 refresh_rate = proto.refresh_rate(); 60 refresh_rate = proto.refresh_rate();
60 highp_threshold_min = proto.highp_threshold_min(); 61 highp_threshold_min = proto.highp_threshold_min();
61 use_rgba_4444_textures = proto.use_rgba_4444_textures();
62 texture_id_allocation_chunk_size = proto.texture_id_allocation_chunk_size(); 62 texture_id_allocation_chunk_size = proto.texture_id_allocation_chunk_size();
63 use_gpu_memory_buffer_resources = proto.use_gpu_memory_buffer_resources(); 63 use_gpu_memory_buffer_resources = proto.use_gpu_memory_buffer_resources();
64
65 DCHECK_LE(proto.preferred_tile_format(),
66 static_cast<uint32_t>(RESOURCE_FORMAT_MAX));
67 preferred_tile_format =
68 static_cast<ResourceFormat>(proto.preferred_tile_format());
64 } 69 }
65 70
66 bool RendererSettings::operator==(const RendererSettings& other) const { 71 bool RendererSettings::operator==(const RendererSettings& other) const {
67 return allow_antialiasing == other.allow_antialiasing && 72 return allow_antialiasing == other.allow_antialiasing &&
68 force_antialiasing == other.force_antialiasing && 73 force_antialiasing == other.force_antialiasing &&
69 force_blending_with_shaders == other.force_blending_with_shaders && 74 force_blending_with_shaders == other.force_blending_with_shaders &&
70 partial_swap_enabled == other.partial_swap_enabled && 75 partial_swap_enabled == other.partial_swap_enabled &&
71 finish_rendering_on_resize == other.finish_rendering_on_resize && 76 finish_rendering_on_resize == other.finish_rendering_on_resize &&
72 should_clear_root_render_pass == other.should_clear_root_render_pass && 77 should_clear_root_render_pass == other.should_clear_root_render_pass &&
73 disable_display_vsync == other.disable_display_vsync && 78 disable_display_vsync == other.disable_display_vsync &&
74 release_overlay_resources_on_swap_complete == 79 release_overlay_resources_on_swap_complete ==
75 other.release_overlay_resources_on_swap_complete && 80 other.release_overlay_resources_on_swap_complete &&
76 refresh_rate == other.refresh_rate && 81 refresh_rate == other.refresh_rate &&
77 highp_threshold_min == other.highp_threshold_min && 82 highp_threshold_min == other.highp_threshold_min &&
78 use_rgba_4444_textures == other.use_rgba_4444_textures &&
79 texture_id_allocation_chunk_size == 83 texture_id_allocation_chunk_size ==
80 other.texture_id_allocation_chunk_size && 84 other.texture_id_allocation_chunk_size &&
81 use_gpu_memory_buffer_resources == 85 use_gpu_memory_buffer_resources ==
82 other.use_gpu_memory_buffer_resources; 86 other.use_gpu_memory_buffer_resources &&
87 preferred_tile_format == other.preferred_tile_format;
83 } 88 }
84 89
85 } // namespace cc 90 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/renderer_settings.h ('k') | cc/output/renderer_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698