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

Side by Side Diff: ui/compositor/compositor.cc

Issue 1381163002: Add a flag to disable partial raster in renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback + UT refactoring Created 5 years, 2 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 | « content/test/fake_compositor_dependencies.cc ('k') | no next file » | 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 "ui/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); 133 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects);
134 134
135 settings.initial_debug_state.SetRecordRenderingStats( 135 settings.initial_debug_state.SetRecordRenderingStats(
136 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); 136 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking));
137 137
138 settings.use_zero_copy = IsUIZeroCopyEnabled(); 138 settings.use_zero_copy = IsUIZeroCopyEnabled();
139 139
140 settings.renderer_settings.use_rgba_4444_textures = 140 settings.renderer_settings.use_rgba_4444_textures =
141 command_line->HasSwitch(switches::kUIEnableRGBA4444Textures); 141 command_line->HasSwitch(switches::kUIEnableRGBA4444Textures);
142 142
143 // Use PERSISTENT_MAP memory buffers to support partial tile raster for 143 // UI compositor always uses partial raster if not using zero-copy. Zero copy
144 // software raster into GpuMemoryBuffers. 144 // doesn't currently support partial raster.
145 gfx::BufferUsage usage = gfx::BufferUsage::PERSISTENT_MAP; 145 settings.use_partial_raster = !settings.use_zero_copy;
146 settings.use_persistent_map_for_gpu_memory_buffers = true; 146
147 // Use PERSISTENT_MAP memory buffers to support partial tile raster if needed.
148 gfx::BufferUsage usage = settings.use_partial_raster
149 ? gfx::BufferUsage::PERSISTENT_MAP
150 : gfx::BufferUsage::MAP;
147 151
148 for (size_t format = 0; 152 for (size_t format = 0;
149 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { 153 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) {
150 DCHECK_GT(settings.use_image_texture_targets.size(), format); 154 DCHECK_GT(settings.use_image_texture_targets.size(), format);
151 settings.use_image_texture_targets[format] = 155 settings.use_image_texture_targets[format] =
152 context_factory_->GetImageTextureTarget( 156 context_factory_->GetImageTextureTarget(
153 static_cast<gfx::BufferFormat>(format), usage); 157 static_cast<gfx::BufferFormat>(format), usage);
154 } 158 }
155 159
156 // Note: Only enable image decode tasks if we have more than one worker 160 // Note: Only enable image decode tasks if we have more than one worker
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 observer_list_, 491 observer_list_,
488 OnCompositingLockStateChanged(this)); 492 OnCompositingLockStateChanged(this));
489 } 493 }
490 494
491 void Compositor::CancelCompositorLock() { 495 void Compositor::CancelCompositorLock() {
492 if (compositor_lock_) 496 if (compositor_lock_)
493 compositor_lock_->CancelLock(); 497 compositor_lock_->CancelLock();
494 } 498 }
495 499
496 } // namespace ui 500 } // namespace ui
OLDNEW
« no previous file with comments | « content/test/fake_compositor_dependencies.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698