OLD | NEW |
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 "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 2130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2141 | 2141 |
2142 void RenderWidgetHostImpl::DidReceiveRendererFrame() { | 2142 void RenderWidgetHostImpl::DidReceiveRendererFrame() { |
2143 view_->DidReceiveRendererFrame(); | 2143 view_->DidReceiveRendererFrame(); |
2144 } | 2144 } |
2145 | 2145 |
2146 void RenderWidgetHostImpl::WindowSnapshotAsyncCallback( | 2146 void RenderWidgetHostImpl::WindowSnapshotAsyncCallback( |
2147 int routing_id, | 2147 int routing_id, |
2148 int snapshot_id, | 2148 int snapshot_id, |
2149 gfx::Size snapshot_size, | 2149 gfx::Size snapshot_size, |
2150 scoped_refptr<base::RefCountedBytes> png_data) { | 2150 scoped_refptr<base::RefCountedBytes> png_data) { |
2151 if (!png_data) { | 2151 if (!png_data.get()) { |
2152 std::vector<unsigned char> png_vector; | 2152 std::vector<unsigned char> png_vector; |
2153 Send(new ViewMsg_WindowSnapshotCompleted( | 2153 Send(new ViewMsg_WindowSnapshotCompleted( |
2154 routing_id, snapshot_id, gfx::Size(), png_vector)); | 2154 routing_id, snapshot_id, gfx::Size(), png_vector)); |
2155 return; | 2155 return; |
2156 } | 2156 } |
2157 | 2157 |
2158 Send(new ViewMsg_WindowSnapshotCompleted( | 2158 Send(new ViewMsg_WindowSnapshotCompleted( |
2159 routing_id, snapshot_id, snapshot_size, png_data->data())); | 2159 routing_id, snapshot_id, snapshot_size, png_data->data())); |
2160 } | 2160 } |
2161 | 2161 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2230 pending_browser_snapshots_.erase(it++); | 2230 pending_browser_snapshots_.erase(it++); |
2231 } else { | 2231 } else { |
2232 ++it; | 2232 ++it; |
2233 } | 2233 } |
2234 } | 2234 } |
2235 } | 2235 } |
2236 | 2236 |
2237 void RenderWidgetHostImpl::OnSnapshotDataReceivedAsync( | 2237 void RenderWidgetHostImpl::OnSnapshotDataReceivedAsync( |
2238 int snapshot_id, | 2238 int snapshot_id, |
2239 scoped_refptr<base::RefCountedBytes> png_data) { | 2239 scoped_refptr<base::RefCountedBytes> png_data) { |
2240 if (png_data) | 2240 if (png_data.get()) |
2241 OnSnapshotDataReceived(snapshot_id, png_data->front(), png_data->size()); | 2241 OnSnapshotDataReceived(snapshot_id, png_data->front(), png_data->size()); |
2242 else | 2242 else |
2243 OnSnapshotDataReceived(snapshot_id, NULL, 0); | 2243 OnSnapshotDataReceived(snapshot_id, NULL, 0); |
2244 } | 2244 } |
2245 | 2245 |
2246 // static | 2246 // static |
2247 void RenderWidgetHostImpl::CompositorFrameDrawn( | 2247 void RenderWidgetHostImpl::CompositorFrameDrawn( |
2248 const std::vector<ui::LatencyInfo>& latency_info) { | 2248 const std::vector<ui::LatencyInfo>& latency_info) { |
2249 for (size_t i = 0; i < latency_info.size(); i++) { | 2249 for (size_t i = 0; i < latency_info.size(); i++) { |
2250 std::set<RenderWidgetHostImpl*> rwhi_set; | 2250 std::set<RenderWidgetHostImpl*> rwhi_set; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2317 } | 2317 } |
2318 #endif | 2318 #endif |
2319 | 2319 |
2320 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2320 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2321 if (view_) | 2321 if (view_) |
2322 return view_->PreferredReadbackFormat(); | 2322 return view_->PreferredReadbackFormat(); |
2323 return kN32_SkColorType; | 2323 return kN32_SkColorType; |
2324 } | 2324 } |
2325 | 2325 |
2326 } // namespace content | 2326 } // namespace content |
OLD | NEW |