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

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

Issue 2045743003: cc: Add traces for identification of raster buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: correction Created 4 years, 6 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/raster_buffer_provider.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 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 18 matching lines...) Expand all
29 : lock_(resource_provider, resource->id()), resource_(resource) {} 29 : lock_(resource_provider, resource->id()), resource_(resource) {}
30 30
31 // Overridden from RasterBuffer: 31 // Overridden from RasterBuffer:
32 void Playback( 32 void Playback(
33 const RasterSource* raster_source, 33 const RasterSource* raster_source,
34 const gfx::Rect& raster_full_rect, 34 const gfx::Rect& raster_full_rect,
35 const gfx::Rect& raster_dirty_rect, 35 const gfx::Rect& raster_dirty_rect,
36 uint64_t new_content_id, 36 uint64_t new_content_id,
37 float scale, 37 float scale,
38 const RasterSource::PlaybackSettings& playback_settings) override { 38 const RasterSource::PlaybackSettings& playback_settings) override {
39 TRACE_EVENT0("cc", "ZeroCopyRasterBuffer::Playback");
39 gfx::GpuMemoryBuffer* buffer = lock_.GetGpuMemoryBuffer(); 40 gfx::GpuMemoryBuffer* buffer = lock_.GetGpuMemoryBuffer();
40 if (!buffer) 41 if (!buffer)
41 return; 42 return;
42 43
43 DCHECK_EQ(1u, gfx::NumberOfPlanesForBufferFormat(buffer->GetFormat())); 44 DCHECK_EQ(1u, gfx::NumberOfPlanesForBufferFormat(buffer->GetFormat()));
44 bool rv = buffer->Map(); 45 bool rv = buffer->Map();
45 DCHECK(rv); 46 DCHECK(rv);
46 DCHECK(buffer->memory(0)); 47 DCHECK(buffer->memory(0));
47 // RasterBufferProvider::PlaybackToMemory only supports unsigned strides. 48 // RasterBufferProvider::PlaybackToMemory only supports unsigned strides.
48 DCHECK_GE(buffer->stride(0), 0); 49 DCHECK_GE(buffer->stride(0), 0);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 112 }
112 113
113 bool ZeroCopyRasterBufferProvider::GetResourceRequiresSwizzle( 114 bool ZeroCopyRasterBufferProvider::GetResourceRequiresSwizzle(
114 bool must_support_alpha) const { 115 bool must_support_alpha) const {
115 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); 116 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha));
116 } 117 }
117 118
118 void ZeroCopyRasterBufferProvider::Shutdown() {} 119 void ZeroCopyRasterBufferProvider::Shutdown() {}
119 120
120 } // namespace cc 121 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/raster_buffer_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698