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

Side by Side Diff: skia/ext/bitmap_platform_device_skia.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « skia/ext/bitmap_platform_device_skia.h ('k') | skia/ext/bitmap_platform_device_win.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 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 "skia/ext/bitmap_platform_device_skia.h" 5 #include "skia/ext/bitmap_platform_device_skia.h"
6 #include "skia/ext/platform_canvas.h" 6 #include "skia/ext/platform_canvas.h"
7 7
8 namespace skia { 8 namespace skia {
9 9
10 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, 10 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 BitmapPlatformDevice::BitmapPlatformDevice(const SkBitmap& bitmap) 46 BitmapPlatformDevice::BitmapPlatformDevice(const SkBitmap& bitmap)
47 : SkBitmapDevice(bitmap) { 47 : SkBitmapDevice(bitmap) {
48 SetPlatformDevice(this, this); 48 SetPlatformDevice(this, this);
49 } 49 }
50 50
51 BitmapPlatformDevice::~BitmapPlatformDevice() { 51 BitmapPlatformDevice::~BitmapPlatformDevice() {
52 } 52 }
53 53
54 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const SkImageInfo& info, 54 SkBaseDevice* BitmapPlatformDevice::onCreateCompatibleDevice(
55 Usage /*usage*/) { 55 const CreateInfo& info) {
56 SkASSERT(info.colorType() == kN32_SkColorType); 56 SkASSERT(info.fInfo.colorType() == kN32_SkColorType);
57 return BitmapPlatformDevice::Create(info.width(), info.height(), 57 return BitmapPlatformDevice::Create(info.fInfo.width(), info.fInfo.height(),
58 info.isOpaque()); 58 info.fInfo.isOpaque());
59 } 59 }
60 60
61 PlatformSurface BitmapPlatformDevice::BeginPlatformPaint() { 61 PlatformSurface BitmapPlatformDevice::BeginPlatformPaint() {
62 // TODO(zhenghao): What should we return? The ptr to the address of the 62 // TODO(zhenghao): What should we return? The ptr to the address of the
63 // pixels? Maybe this won't be called at all. 63 // pixels? Maybe this won't be called at all.
64 return accessBitmap(true).getPixels(); 64 return accessBitmap(true).getPixels();
65 } 65 }
66 66
67 void BitmapPlatformDevice::DrawToNativeContext( 67 void BitmapPlatformDevice::DrawToNativeContext(
68 PlatformSurface surface, int x, int y, const PlatformRect* src_rect) { 68 PlatformSurface surface, int x, int y, const PlatformRect* src_rect) {
(...skipping 17 matching lines...) Expand all
86 86
87 bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) { 87 bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
88 if (!bitmap_.tryAllocN32Pixels(width, height, is_opaque)) 88 if (!bitmap_.tryAllocN32Pixels(width, height, is_opaque))
89 return false; 89 return false;
90 90
91 surface_ = bitmap_.getPixels(); 91 surface_ = bitmap_.getPixels();
92 return true; 92 return true;
93 } 93 }
94 94
95 } // namespace skia 95 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_skia.h ('k') | skia/ext/bitmap_platform_device_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698