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

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

Issue 9416017: Optionally clear PlatformCanvas instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address comments. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « skia/ext/platform_canvas_unittest.cc ('k') | skia/ext/vector_canvas_unittest.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 <windows.h> 5 #include <windows.h>
6 #include <psapi.h> 6 #include <psapi.h>
7 7
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "skia/ext/bitmap_platform_device_win.h" 9 #include "skia/ext/bitmap_platform_device_win.h"
10 #include "skia/ext/platform_canvas.h" 10 #include "skia/ext/platform_canvas.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 initialize(width, height, is_opaque, shared_section); 88 initialize(width, height, is_opaque, shared_section);
89 } 89 }
90 90
91 PlatformCanvas::~PlatformCanvas() { 91 PlatformCanvas::~PlatformCanvas() {
92 } 92 }
93 93
94 bool PlatformCanvas::initialize(int width, 94 bool PlatformCanvas::initialize(int width,
95 int height, 95 int height,
96 bool is_opaque, 96 bool is_opaque,
97 HANDLE shared_section) { 97 HANDLE shared_section) {
98 if (initializeWithDevice(BitmapPlatformDevice::create(width, 98 if (initializeWithDevice(BitmapPlatformDevice::Create(width,
99 height, 99 height,
100 is_opaque, 100 is_opaque,
101 shared_section))) 101 shared_section)))
102 return true; 102 return true;
103 // Investigate we failed. If we know the reason, crash in a specific place. 103 // Investigate we failed. If we know the reason, crash in a specific place.
104 unsigned int error = GetLastError(); 104 unsigned int error = GetLastError();
105 if (shared_section) 105 if (shared_section)
106 CrashIfInvalidSection(shared_section); 106 CrashIfInvalidSection(shared_section);
107 CrashForBitmapAllocationFailure(width, height, error); 107 CrashForBitmapAllocationFailure(width, height, error);
108 return false; 108 return false;
109 } 109 }
110 110
111 } // namespace skia 111 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/platform_canvas_unittest.cc ('k') | skia/ext/vector_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698