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

Side by Side Diff: cc/output/software_frame_data.cc

Issue 221523003: cc: Remove all usage of GetArea() from production code in cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: getarea: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/output/software_frame_data.h ('k') | cc/resources/resource_provider.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 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/output/software_frame_data.h" 5 #include "cc/output/software_frame_data.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 SoftwareFrameData::SoftwareFrameData() 9 SoftwareFrameData::SoftwareFrameData()
10 : id(0), 10 : id(0),
11 handle(base::SharedMemory::NULLHandle()) {} 11 handle(base::SharedMemory::NULLHandle()) {}
12 12
13 SoftwareFrameData::~SoftwareFrameData() {} 13 SoftwareFrameData::~SoftwareFrameData() {}
14 14
15 size_t SoftwareFrameData::SizeInBytes() const {
16 size_t bytes_per_pixel = 4;
17 size_t width = size.width();
18 size_t height = size.height();
19 return bytes_per_pixel * width * height;
20 }
21
22 base::CheckedNumeric<size_t> SoftwareFrameData::CheckedSizeInBytes() const {
23 return base::CheckedNumeric<size_t>(4) *
24 base::CheckedNumeric<size_t>(size.width()) *
25 base::CheckedNumeric<size_t>(size.height());
26 }
27
28 } // namespace cc 15 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/software_frame_data.h ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698