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

Side by Side Diff: content/browser/compositor/software_output_device_win.cc

Issue 2595023002: clean-up and clarify CreatePlatformCanvas methods (Closed)
Patch Set: single decl of CreatePlatformCanvasWithPixels Created 4 years 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 | « no previous file | skia/ext/bitmap_platform_device_cairo.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/compositor/software_output_device_win.h" 5 #include "content/browser/compositor/software_output_device_win.h"
6 6
7 #include "base/debug/alias.h" 7 #include "base/debug/alias.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "cc/resources/shared_bitmap.h" 9 #include "cc/resources/shared_bitmap.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 if (backing_) { 132 if (backing_) {
133 base::SharedMemory* memory = 133 base::SharedMemory* memory =
134 backing_->GetSharedMemory(viewport_pixel_size_); 134 backing_->GetSharedMemory(viewport_pixel_size_);
135 if (memory) { 135 if (memory) {
136 shared_section = memory->handle().GetHandle(); 136 shared_section = memory->handle().GetHandle();
137 } else { 137 } else {
138 can_create_contents = false; 138 can_create_contents = false;
139 } 139 }
140 } 140 }
141 if (can_create_contents) { 141 if (can_create_contents) {
142 contents_ = skia::CreatePlatformCanvas( 142 contents_ = skia::CreatePlatformCanvasWithSharedSection(
143 viewport_pixel_size_.width(), viewport_pixel_size_.height(), true, 143 viewport_pixel_size_.width(), viewport_pixel_size_.height(), true,
144 shared_section, skia::CRASH_ON_FAILURE); 144 shared_section, skia::CRASH_ON_FAILURE);
145 } 145 }
146 } 146 }
147 147
148 damage_rect_ = damage_rect; 148 damage_rect_ = damage_rect;
149 in_paint_ = true; 149 in_paint_ = true;
150 return contents_.get(); 150 return contents_.get();
151 } 151 }
152 152
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 ::ReleaseDC(hwnd_, hdc); 190 ::ReleaseDC(hwnd_, hdc);
191 } 191 }
192 } 192 }
193 193
194 void SoftwareOutputDeviceWin::ReleaseContents() { 194 void SoftwareOutputDeviceWin::ReleaseContents() {
195 DCHECK(!in_paint_); 195 DCHECK(!in_paint_);
196 contents_.reset(); 196 contents_.reset();
197 } 197 }
198 198
199 } // namespace content 199 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | skia/ext/bitmap_platform_device_cairo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698