| OLD | NEW |
| 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 28 matching lines...) Expand all Loading... |
| 39 TRACE_EVENT0("cc", "ZeroCopyRasterBuffer::Playback"); | 39 TRACE_EVENT0("cc", "ZeroCopyRasterBuffer::Playback"); |
| 40 gfx::GpuMemoryBuffer* buffer = lock_.GetGpuMemoryBuffer(); | 40 gfx::GpuMemoryBuffer* buffer = lock_.GetGpuMemoryBuffer(); |
| 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); | |
| 50 | 49 |
| 51 // TODO(danakj): Implement partial raster with raster_dirty_rect. | 50 // TODO(danakj): Implement partial raster with raster_dirty_rect. |
| 52 RasterBufferProvider::PlaybackToMemory( | 51 RasterBufferProvider::PlaybackToMemory( |
| 53 buffer->memory(0), resource_->format(), resource_->size(), | 52 buffer->memory(0), resource_->format(), resource_->size(), |
| 54 buffer->stride(0), raster_source, raster_full_rect, raster_full_rect, | 53 buffer->stride(0), raster_source, raster_full_rect, raster_full_rect, |
| 55 scale, playback_settings); | 54 scale, playback_settings); |
| 56 buffer->Unmap(); | 55 buffer->Unmap(); |
| 57 } | 56 } |
| 58 | 57 |
| 59 private: | 58 private: |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 116 } |
| 118 | 117 |
| 119 bool ZeroCopyRasterBufferProvider::CanPartialRasterIntoProvidedResource() | 118 bool ZeroCopyRasterBufferProvider::CanPartialRasterIntoProvidedResource() |
| 120 const { | 119 const { |
| 121 return false; | 120 return false; |
| 122 } | 121 } |
| 123 | 122 |
| 124 void ZeroCopyRasterBufferProvider::Shutdown() {} | 123 void ZeroCopyRasterBufferProvider::Shutdown() {} |
| 125 | 124 |
| 126 } // namespace cc | 125 } // namespace cc |
| OLD | NEW |