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

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

Issue 2702633002: color: Remove implied color space (Closed)
Patch Set: Rebase Created 3 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/raster/one_copy_raster_buffer_provider.cc ('k') | cc/resources/resource_provider.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/zero_copy_raster_buffer_provider.h" 5 #include "cc/raster/zero_copy_raster_buffer_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 30 matching lines...) Expand all
41 if (!buffer) 41 if (!buffer)
42 return; 42 return;
43 43
44 DCHECK_EQ(1u, gfx::NumberOfPlanesForBufferFormat(buffer->GetFormat())); 44 DCHECK_EQ(1u, gfx::NumberOfPlanesForBufferFormat(buffer->GetFormat()));
45 bool rv = buffer->Map(); 45 bool rv = buffer->Map();
46 DCHECK(rv); 46 DCHECK(rv);
47 DCHECK(buffer->memory(0)); 47 DCHECK(buffer->memory(0));
48 // RasterBufferProvider::PlaybackToMemory only supports unsigned strides. 48 // RasterBufferProvider::PlaybackToMemory only supports unsigned strides.
49 DCHECK_GE(buffer->stride(0), 0); 49 DCHECK_GE(buffer->stride(0), 0);
50 50
51 sk_sp<SkColorSpace> raster_color_space =
52 raster_source->HasImpliedColorSpace() ? nullptr
53 : lock_.sk_color_space();
54
55 // TODO(danakj): Implement partial raster with raster_dirty_rect. 51 // TODO(danakj): Implement partial raster with raster_dirty_rect.
56 RasterBufferProvider::PlaybackToMemory( 52 RasterBufferProvider::PlaybackToMemory(
57 buffer->memory(0), resource_->format(), resource_->size(), 53 buffer->memory(0), resource_->format(), resource_->size(),
58 buffer->stride(0), raster_source, raster_full_rect, raster_full_rect, 54 buffer->stride(0), raster_source, raster_full_rect, raster_full_rect,
59 scale, raster_color_space, playback_settings); 55 scale, lock_.sk_color_space(), playback_settings);
60 buffer->Unmap(); 56 buffer->Unmap();
61 } 57 }
62 58
63 private: 59 private:
64 ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock_; 60 ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock_;
65 const Resource* resource_; 61 const Resource* resource_;
66 62
67 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl); 63 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
68 }; 64 };
69 65
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const ResourceProvider::ResourceIdArray& resource_ids, 131 const ResourceProvider::ResourceIdArray& resource_ids,
136 const base::Closure& callback, 132 const base::Closure& callback,
137 uint64_t pending_callback_id) const { 133 uint64_t pending_callback_id) const {
138 // Zero-copy resources are immediately ready to draw. 134 // Zero-copy resources are immediately ready to draw.
139 return 0; 135 return 0;
140 } 136 }
141 137
142 void ZeroCopyRasterBufferProvider::Shutdown() {} 138 void ZeroCopyRasterBufferProvider::Shutdown() {}
143 139
144 } // namespace cc 140 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/one_copy_raster_buffer_provider.cc ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698