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

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

Issue 10093006: Fix win32 error checking in platform_canvas_skia.cc by moving code into ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove reduction of code duplication from patch as there's still some uncertainty about how to best… Created 8 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 | « skia/ext/bitmap_platform_device_win.cc ('k') | skia/ext/platform_canvas_win.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/platform_canvas.h" 5 #include "skia/ext/platform_canvas.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "skia/ext/bitmap_platform_device.h" 8 #include "skia/ext/bitmap_platform_device.h"
9 9
10 // TODO(reveman): a lot of unnecessary duplication of code from 10 // TODO(reveman): a lot of unnecessary duplication of code from
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 PlatformCanvas::~PlatformCanvas() { 62 PlatformCanvas::~PlatformCanvas() {
63 } 63 }
64 64
65 #if defined(WIN32) 65 #if defined(WIN32)
66 bool PlatformCanvas::initialize(int width, 66 bool PlatformCanvas::initialize(int width,
67 int height, 67 int height,
68 bool is_opaque, 68 bool is_opaque,
69 HANDLE shared_section) { 69 HANDLE shared_section) {
70 // Use platform specific device for shared_section. 70 // Use platform specific device for shared_section.
71 if (shared_section) { 71 if (shared_section)
72 if (initializeWithDevice(BitmapPlatformDevice::Create(width, 72 return initializeWithDevice(BitmapPlatformDevice::Create(
73 height, 73 width, height, is_opaque, shared_section));
74 is_opaque,
75 shared_section)))
76 return true;
77
78 // TODO(reveman): move the failure investigation from
79 // platform_canvas_win.cc to bitmap_platform_device_win.cc.
80 return false;
81 }
82 74
83 return initializeWithDevice(new SkDevice( 75 return initializeWithDevice(new SkDevice(
84 SkBitmap::kARGB_8888_Config, width, height, is_opaque)); 76 SkBitmap::kARGB_8888_Config, width, height, is_opaque));
85 } 77 }
86 #elif defined(__APPLE__) 78 #elif defined(__APPLE__)
87 bool PlatformCanvas::initialize(int width, 79 bool PlatformCanvas::initialize(int width,
88 int height, 80 int height,
89 bool is_opaque, 81 bool is_opaque,
90 uint8_t* data) { 82 uint8_t* data) {
91 // Use platform specific device for data. 83 // Use platform specific device for data.
(...skipping 20 matching lines...) Expand all
112 if (data) 104 if (data)
113 return initializeWithDevice(BitmapPlatformDevice::Create( 105 return initializeWithDevice(BitmapPlatformDevice::Create(
114 width, height, is_opaque, data)); 106 width, height, is_opaque, data));
115 107
116 return initializeWithDevice(new SkDevice( 108 return initializeWithDevice(new SkDevice(
117 SkBitmap::kARGB_8888_Config, width, height, is_opaque)); 109 SkBitmap::kARGB_8888_Config, width, height, is_opaque));
118 } 110 }
119 #endif 111 #endif
120 112
121 } // namespace skia 113 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_win.cc ('k') | skia/ext/platform_canvas_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698