| 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_ozone.h" | 5 #include "content/browser/compositor/software_output_device_ozone.h" |
| 6 #include "third_party/skia/include/core/SkDevice.h" | 6 #include "third_party/skia/include/core/SkDevice.h" |
| 7 #include "ui/compositor/compositor.h" | 7 #include "ui/compositor/compositor.h" |
| 8 #include "ui/gfx/skia_util.h" | 8 #include "ui/gfx/skia_util.h" |
| 9 #include "ui/gfx/vsync_provider.h" | 9 #include "ui/gfx/vsync_provider.h" |
| 10 #include "ui/ozone/public/surface_factory_ozone.h" | 10 #include "ui/ozone/public/surface_factory_ozone.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 viewport_pixel_size_ = viewport_pixel_size; | 37 viewport_pixel_size_ = viewport_pixel_size; |
| 38 | 38 |
| 39 surface_ozone_->ResizeCanvas(viewport_pixel_size_); | 39 surface_ozone_->ResizeCanvas(viewport_pixel_size_); |
| 40 } | 40 } |
| 41 | 41 |
| 42 SkCanvas* SoftwareOutputDeviceOzone::BeginPaint(const gfx::Rect& damage_rect) { | 42 SkCanvas* SoftwareOutputDeviceOzone::BeginPaint(const gfx::Rect& damage_rect) { |
| 43 DCHECK(gfx::Rect(viewport_pixel_size_).Contains(damage_rect)); | 43 DCHECK(gfx::Rect(viewport_pixel_size_).Contains(damage_rect)); |
| 44 | 44 |
| 45 // Get canvas for next frame. | 45 // Get canvas for next frame. |
| 46 canvas_ = surface_ozone_->GetCanvas(); | 46 surface_ = surface_ozone_->GetSurface(); |
| 47 | 47 |
| 48 return SoftwareOutputDevice::BeginPaint(damage_rect); | 48 return SoftwareOutputDevice::BeginPaint(damage_rect); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void SoftwareOutputDeviceOzone::EndPaint(cc::SoftwareFrameData* frame_data) { | 51 void SoftwareOutputDeviceOzone::EndPaint(cc::SoftwareFrameData* frame_data) { |
| 52 SoftwareOutputDevice::EndPaint(frame_data); | 52 SoftwareOutputDevice::EndPaint(frame_data); |
| 53 | 53 |
| 54 surface_ozone_->PresentCanvas(damage_rect_); | 54 surface_ozone_->PresentCanvas(damage_rect_); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace content | 57 } // namespace content |
| OLD | NEW |