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

Side by Side Diff: ui/surface/transport_dib.cc

Issue 1544283002: Clean up header files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « ui/gfx/render_text_unittest.cc ('k') | ui/views/view_targeter_delegate.cc » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/surface/transport_dib.h" 5 #include "ui/surface/transport_dib.h"
6 6
7 #include <limits.h>
8
7 #include "skia/ext/platform_canvas.h" 9 #include "skia/ext/platform_canvas.h"
8 10
9 // static 11 // static
10 bool TransportDIB::VerifyCanvasSize(int w, int h) { 12 bool TransportDIB::VerifyCanvasSize(int w, int h) {
11 static const size_t kMaxSize = static_cast<size_t>(INT_MAX); 13 static const size_t kMaxSize = static_cast<size_t>(INT_MAX);
12 const size_t one_stride = skia::PlatformCanvasStrideForWidth(1); 14 const size_t one_stride = skia::PlatformCanvasStrideForWidth(1);
13 const size_t stride = skia::PlatformCanvasStrideForWidth(w); 15 const size_t stride = skia::PlatformCanvasStrideForWidth(w);
14 if (w <= 0 || h <= 0 || static_cast<size_t>(w) > (kMaxSize / one_stride) || 16 if (w <= 0 || h <= 0 || static_cast<size_t>(w) > (kMaxSize / one_stride) ||
15 static_cast<size_t>(h) > (kMaxSize / stride)) { 17 static_cast<size_t>(h) > (kMaxSize / stride)) {
16 return false; 18 return false;
17 } 19 }
18 20
19 return (stride * h) <= size_; 21 return (stride * h) <= size_;
20 } 22 }
21 23
22 base::SharedMemory* TransportDIB::shared_memory() { 24 base::SharedMemory* TransportDIB::shared_memory() {
23 return &shared_memory_; 25 return &shared_memory_;
24 } 26 }
OLDNEW
« no previous file with comments | « ui/gfx/render_text_unittest.cc ('k') | ui/views/view_targeter_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698