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

Unified Diff: cc/output/renderer_settings.cc

Issue 2120713002: Fix use_image_texture_target inconsistencies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup 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
Index: cc/output/renderer_settings.cc
diff --git a/cc/output/renderer_settings.cc b/cc/output/renderer_settings.cc
index bc809dba765a186601ce335a6ba2c94d41fb7bb9..a2225c131cb931918be704a1caade0a841e51817 100644
--- a/cc/output/renderer_settings.cc
+++ b/cc/output/renderer_settings.cc
@@ -47,6 +47,13 @@ void RendererSettings::ToProtobuf(proto::RendererSettings* proto) const {
proto->set_texture_id_allocation_chunk_size(texture_id_allocation_chunk_size);
proto->set_use_gpu_memory_buffer_resources(use_gpu_memory_buffer_resources);
proto->set_preferred_tile_format(preferred_tile_format);
+
+ for (const auto& target : use_image_texture_targets) {
+ auto* proto_target = proto->add_use_image_texture_targets();
+ proto_target->set_buffer_usage(static_cast<uint32_t>(target.first.first));
+ proto_target->set_buffer_format(static_cast<uint32_t>(target.first.second));
+ proto_target->set_texture_target(target.second);
+ }
}
void RendererSettings::FromProtobuf(const proto::RendererSettings& proto) {
@@ -68,6 +75,16 @@ void RendererSettings::FromProtobuf(const proto::RendererSettings& proto) {
static_cast<uint32_t>(RESOURCE_FORMAT_MAX));
preferred_tile_format =
static_cast<ResourceFormat>(proto.preferred_tile_format());
+
+ // |use_image_texture_targets| may contain existing values, so clear first.
+ use_image_texture_targets.clear();
+ for (const auto& proto_target : proto.use_image_texture_targets()) {
+ use_image_texture_targets.emplace(
+ ImageTextureTargetKey(
+ static_cast<gfx::BufferUsage>(proto_target.buffer_usage()),
+ static_cast<gfx::BufferFormat>(proto_target.buffer_format())),
+ proto_target.texture_target());
+ }
}
bool RendererSettings::operator==(const RendererSettings& other) const {
@@ -86,7 +103,8 @@ bool RendererSettings::operator==(const RendererSettings& other) const {
other.texture_id_allocation_chunk_size &&
use_gpu_memory_buffer_resources ==
other.use_gpu_memory_buffer_resources &&
- preferred_tile_format == other.preferred_tile_format;
+ preferred_tile_format == other.preferred_tile_format &&
+ use_image_texture_targets == other.use_image_texture_targets;
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698