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

Side by Side Diff: cc/raster/one_copy_raster_buffer_provider.cc

Issue 2525453002: Raster: Allow a RasterSource to specify its color space (Closed)
Patch Set: Only set implied space when color correct rendering is disabled Created 4 years 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/raster/gpu_raster_buffer_provider.cc ('k') | cc/raster/zero_copy_raster_buffer_provider.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/raster/one_copy_raster_buffer_provider.h" 5 #include "cc/raster/one_copy_raster_buffer_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 ContextProvider::ScopedContextLock scoped_context(worker_context_provider_); 185 ContextProvider::ScopedContextLock scoped_context(worker_context_provider_);
186 gpu::gles2::GLES2Interface* gl = scoped_context.ContextGL(); 186 gpu::gles2::GLES2Interface* gl = scoped_context.ContextGL();
187 DCHECK(gl); 187 DCHECK(gl);
188 // Synchronize with compositor. 188 // Synchronize with compositor.
189 gl->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); 189 gl->WaitSyncTokenCHROMIUM(sync_token.GetConstData());
190 } 190 }
191 191
192 std::unique_ptr<StagingBuffer> staging_buffer = 192 std::unique_ptr<StagingBuffer> staging_buffer =
193 staging_pool_.AcquireStagingBuffer(resource, previous_content_id); 193 staging_pool_.AcquireStagingBuffer(resource, previous_content_id);
194 194
195 sk_sp<SkColorSpace> raster_color_space =
196 raster_source->HasImpliedColorSpace() ? nullptr
197 : resource_lock->sk_color_space();
198
195 PlaybackToStagingBuffer(staging_buffer.get(), resource, raster_source, 199 PlaybackToStagingBuffer(staging_buffer.get(), resource, raster_source,
196 raster_full_rect, raster_dirty_rect, scales, 200 raster_full_rect, raster_dirty_rect, scales,
197 resource_lock->sk_color_space(), playback_settings, 201 raster_color_space, playback_settings,
198 previous_content_id, new_content_id); 202 previous_content_id, new_content_id);
199 203
200 CopyOnWorkerThread(staging_buffer.get(), resource_lock, sync_token, 204 CopyOnWorkerThread(staging_buffer.get(), resource_lock, sync_token,
201 raster_source, previous_content_id, new_content_id); 205 raster_source, previous_content_id, new_content_id);
202 206
203 staging_pool_.ReleaseStagingBuffer(std::move(staging_buffer)); 207 staging_pool_.ReleaseStagingBuffer(std::move(staging_buffer));
204 } 208 }
205 209
206 void OneCopyRasterBufferProvider::PlaybackToStagingBuffer( 210 void OneCopyRasterBufferProvider::PlaybackToStagingBuffer(
207 StagingBuffer* staging_buffer, 211 StagingBuffer* staging_buffer,
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 resource_lock->set_synchronized(!async_worker_context_enabled_); 385 resource_lock->set_synchronized(!async_worker_context_enabled_);
382 } 386 }
383 387
384 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { 388 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const {
385 return use_partial_raster_ 389 return use_partial_raster_
386 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT 390 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT
387 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; 391 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE;
388 } 392 }
389 393
390 } // namespace cc 394 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/gpu_raster_buffer_provider.cc ('k') | cc/raster/zero_copy_raster_buffer_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698