diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 03:55:47 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 03:55:47 +0000 |
commit | 542bdfe5dde965d920bfca1328d0f6e70e8dbb9b (patch) | |
tree | 69f191ddc519eef4fd2ad6c0fae3fc3e3f9f780e /printing/image.h | |
parent | 4e212c3b271b13d22156945997443d00feed6e02 (diff) | |
download | chromium_src-542bdfe5dde965d920bfca1328d0f6e70e8dbb9b.zip chromium_src-542bdfe5dde965d920bfca1328d0f6e70e8dbb9b.tar.gz chromium_src-542bdfe5dde965d920bfca1328d0f6e70e8dbb9b.tar.bz2 |
Revert 67662 - FBTF: Remove unneeded headers from base/ (part 10)
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/5139006
TBR=thestig@chromium.org
Review URL: http://codereview.chromium.org/5270010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67674 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/image.h')
-rw-r--r-- | printing/image.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/printing/image.h b/printing/image.h index 8336a92..d10c61b 100644 --- a/printing/image.h +++ b/printing/image.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,6 +9,7 @@ #include <vector> #include "base/basictypes.h" +#include "base/logging.h" #include "gfx/size.h" #include "printing/native_metafile.h" @@ -55,7 +56,13 @@ class Image { return color; } - uint32 pixel_at(int x, int y) const; + uint32 pixel_at(int x, int y) const { + DCHECK(x >= 0 && x < size_.width()); + DCHECK(y >= 0 && y < size_.height()); + const uint32* data = reinterpret_cast<const uint32*>(&*data_.begin()); + const uint32* data_row = data + y * row_length_ / sizeof(uint32); + return Color(data_row[x]); + } private: // Construct from metafile. This is kept internal since it's ambiguous what |