| OLD | NEW |
| 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/resources/ui_resource_bitmap.h" | 5 #include "cc/resources/ui_resource_bitmap.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> |
| 10 |
| 9 #include "base/logging.h" | 11 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
| 12 #include "third_party/skia/include/core/SkMallocPixelRef.h" | 13 #include "third_party/skia/include/core/SkMallocPixelRef.h" |
| 13 #include "third_party/skia/include/core/SkPixelRef.h" | 14 #include "third_party/skia/include/core/SkPixelRef.h" |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 UIResourceBitmap::UIResourceFormat SkColorTypeToUIResourceFormat( | 19 UIResourceBitmap::UIResourceFormat SkColorTypeToUIResourceFormat( |
| 19 SkColorType sk_type) { | 20 SkColorType sk_type) { |
| 20 UIResourceBitmap::UIResourceFormat format = UIResourceBitmap::RGBA8; | 21 UIResourceBitmap::UIResourceFormat format = UIResourceBitmap::RGBA8; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 89 |
| 89 AutoLockUIResourceBitmap::~AutoLockUIResourceBitmap() { | 90 AutoLockUIResourceBitmap::~AutoLockUIResourceBitmap() { |
| 90 bitmap_.pixel_ref_->unlockPixels(); | 91 bitmap_.pixel_ref_->unlockPixels(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 const uint8_t* AutoLockUIResourceBitmap::GetPixels() const { | 94 const uint8_t* AutoLockUIResourceBitmap::GetPixels() const { |
| 94 return static_cast<const uint8_t*>(bitmap_.pixel_ref_->pixels()); | 95 return static_cast<const uint8_t*>(bitmap_.pixel_ref_->pixels()); |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace cc | 98 } // namespace cc |
| OLD | NEW |