OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |