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

Side by Side Diff: content/renderer/render_process_impl.cc

Issue 11138024: Simplify platform_canvas.h by recognizing that PlatformCanvas does not actually extend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_process_impl.h ('k') | content/renderer/render_widget.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 (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/renderer/render_process_impl.h" 5 #include "content/renderer/render_process_impl.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 delete dib; 144 delete dib;
145 } 145 }
146 146
147 // ----------------------------------------------------------------------------- 147 // -----------------------------------------------------------------------------
148 148
149 149
150 skia::PlatformCanvas* RenderProcessImpl::GetDrawingCanvas( 150 skia::PlatformCanvas* RenderProcessImpl::GetDrawingCanvas(
151 TransportDIB** memory, const gfx::Rect& rect) { 151 TransportDIB** memory, const gfx::Rect& rect) {
152 int width = rect.width(); 152 int width = rect.width();
153 int height = rect.height(); 153 int height = rect.height();
154 const size_t stride = skia::PlatformCanvas::StrideForWidth(rect.width()); 154 const size_t stride = skia::PlatformCanvasStrideForWidth(rect.width());
155 #if defined(OS_LINUX) || defined(OS_OPENBSD) 155 #if defined(OS_LINUX) || defined(OS_OPENBSD)
156 const size_t max_size = base::SysInfo::MaxSharedMemorySize(); 156 const size_t max_size = base::SysInfo::MaxSharedMemorySize();
157 #else 157 #else
158 const size_t max_size = 0; 158 const size_t max_size = 0;
159 #endif 159 #endif
160 160
161 // If the requested size is too big, reduce the height. Ideally we might like 161 // If the requested size is too big, reduce the height. Ideally we might like
162 // to reduce the width as well to make the size reduction more "balanced", but 162 // to reduce the width as well to make the size reduction more "balanced", but
163 // it rarely comes up in practice. 163 // it rarely comes up in practice.
164 if ((max_size != 0) && (height * stride > max_size)) 164 if ((max_size != 0) && (height * stride > max_size))
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 void RenderProcessImpl::ClearTransportDIBCache() { 243 void RenderProcessImpl::ClearTransportDIBCache() {
244 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { 244 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) {
245 if (shared_mem_cache_[i]) { 245 if (shared_mem_cache_[i]) {
246 FreeTransportDIB(shared_mem_cache_[i]); 246 FreeTransportDIB(shared_mem_cache_[i]);
247 shared_mem_cache_[i] = NULL; 247 shared_mem_cache_[i] = NULL;
248 } 248 }
249 } 249 }
250 } 250 }
251 251
252 } // namespace content 252 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_process_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698