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

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

Issue 1320783002: Make SharedMemoryHandle a class on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_global
Patch Set: Rebase. Created 5 years, 2 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
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/memory/shared_memory.h" 7 #include "base/memory/shared_memory.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "skia/ext/platform_canvas.h" 9 #include "skia/ext/platform_canvas.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 backing_->Resized(); 107 backing_->Resized();
108 contents_.clear(); 108 contents_.clear();
109 } 109 }
110 110
111 SkCanvas* SoftwareOutputDeviceWin::BeginPaint(const gfx::Rect& damage_rect) { 111 SkCanvas* SoftwareOutputDeviceWin::BeginPaint(const gfx::Rect& damage_rect) {
112 DCHECK_CURRENTLY_ON(BrowserThread::UI); 112 DCHECK_CURRENTLY_ON(BrowserThread::UI);
113 DCHECK(!in_paint_); 113 DCHECK(!in_paint_);
114 if (!contents_) { 114 if (!contents_) {
115 HANDLE shared_section = NULL; 115 HANDLE shared_section = NULL;
116 if (backing_) 116 if (backing_)
117 shared_section = backing_->GetSharedMemory()->handle(); 117 shared_section = backing_->GetSharedMemory()->handle().GetHandle();
118 contents_ = skia::AdoptRef(skia::CreatePlatformCanvas( 118 contents_ = skia::AdoptRef(skia::CreatePlatformCanvas(
119 viewport_pixel_size_.width(), viewport_pixel_size_.height(), true, 119 viewport_pixel_size_.width(), viewport_pixel_size_.height(), true,
120 shared_section, skia::CRASH_ON_FAILURE)); 120 shared_section, skia::CRASH_ON_FAILURE));
121 } 121 }
122 122
123 damage_rect_ = damage_rect; 123 damage_rect_ = damage_rect;
124 in_paint_ = true; 124 in_paint_ = true;
125 return contents_.get(); 125 return contents_.get();
126 } 126 }
127 127
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 } 165 }
166 166
167 void SoftwareOutputDeviceWin::ReleaseContents() { 167 void SoftwareOutputDeviceWin::ReleaseContents() {
168 DCHECK(!contents_ || contents_->unique()); 168 DCHECK(!contents_ || contents_->unique());
169 DCHECK(!in_paint_); 169 DCHECK(!in_paint_);
170 contents_.clear(); 170 contents_.clear();
171 } 171 }
172 172
173 } // namespace content 173 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698