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

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

Issue 1013453002: remove deprecated onCreateCompatibleDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « 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 24 matching lines...) Expand all
35 } 35 }
36 36
37 BitmapPlatformDevice::BitmapPlatformDevice(const SkBitmap& bitmap) 37 BitmapPlatformDevice::BitmapPlatformDevice(const SkBitmap& bitmap)
38 : SkBitmapDevice(bitmap) { 38 : SkBitmapDevice(bitmap) {
39 SetPlatformDevice(this, this); 39 SetPlatformDevice(this, this);
40 } 40 }
41 41
42 BitmapPlatformDevice::~BitmapPlatformDevice() { 42 BitmapPlatformDevice::~BitmapPlatformDevice() {
43 } 43 }
44 44
45 SkBaseDevice* BitmapPlatformDevice::onCreateCompatibleDevice(
46 const CreateInfo& info) {
47 SkASSERT(info.fInfo.colorType() == kN32_SkColorType);
48 return BitmapPlatformDevice::Create(info.fInfo.width(), info.fInfo.height(),
49 info.fInfo.isOpaque());
50 }
51
52 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& info, 45 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& info,
53 const SkPaint*) { 46 const SkPaint*) {
54 SkASSERT(info.fInfo.colorType() == kN32_SkColorType); 47 SkASSERT(info.fInfo.colorType() == kN32_SkColorType);
55 return BitmapPlatformDevice::Create(info.fInfo.width(), info.fInfo.height(), 48 return BitmapPlatformDevice::Create(info.fInfo.width(), info.fInfo.height(),
56 info.fInfo.isOpaque()); 49 info.fInfo.isOpaque());
57 } 50 }
58 51
59 PlatformSurface BitmapPlatformDevice::BeginPlatformPaint() { 52 PlatformSurface BitmapPlatformDevice::BeginPlatformPaint() {
60 // TODO(zhenghao): What should we return? The ptr to the address of the 53 // TODO(zhenghao): What should we return? The ptr to the address of the
61 // pixels? Maybe this won't be called at all. 54 // pixels? Maybe this won't be called at all.
(...skipping 16 matching lines...) Expand all
78 71
79 bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) { 72 bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
80 if (!bitmap_.tryAllocN32Pixels(width, height, is_opaque)) 73 if (!bitmap_.tryAllocN32Pixels(width, height, is_opaque))
81 return false; 74 return false;
82 75
83 surface_ = bitmap_.getPixels(); 76 surface_ = bitmap_.getPixels();
84 return true; 77 return true;
85 } 78 }
86 79
87 } // namespace skia 80 } // 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