OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/in_process/synchronous_compositor_output_surfa
ce.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "cc/output/begin_frame_args.h" | 9 #include "cc/output/begin_frame_args.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 class SynchronousCompositorOutputSurface::SoftwareDevice | 38 class SynchronousCompositorOutputSurface::SoftwareDevice |
39 : public cc::SoftwareOutputDevice { | 39 : public cc::SoftwareOutputDevice { |
40 public: | 40 public: |
41 SoftwareDevice(SynchronousCompositorOutputSurface* surface) | 41 SoftwareDevice(SynchronousCompositorOutputSurface* surface) |
42 : surface_(surface) { | 42 : surface_(surface) { |
43 } | 43 } |
44 virtual void Resize(const gfx::Size& pixel_size, | 44 virtual void Resize(const gfx::Size& pixel_size, |
45 float scale_factor) OVERRIDE { | 45 float scale_factor) override { |
46 // Intentional no-op: canvas size is controlled by the embedder. | 46 // Intentional no-op: canvas size is controlled by the embedder. |
47 } | 47 } |
48 virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE { | 48 virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override { |
49 if (!surface_->current_sw_canvas_) { | 49 if (!surface_->current_sw_canvas_) { |
50 NOTREACHED() << "BeginPaint with no canvas set"; | 50 NOTREACHED() << "BeginPaint with no canvas set"; |
51 return &null_canvas_; | 51 return &null_canvas_; |
52 } | 52 } |
53 LOG_IF(WARNING, surface_->frame_holder_.get()) | 53 LOG_IF(WARNING, surface_->frame_holder_.get()) |
54 << "Mutliple calls to BeginPaint per frame"; | 54 << "Mutliple calls to BeginPaint per frame"; |
55 return surface_->current_sw_canvas_; | 55 return surface_->current_sw_canvas_; |
56 } | 56 } |
57 virtual void EndPaint(cc::SoftwareFrameData* frame_data) OVERRIDE { | 57 virtual void EndPaint(cc::SoftwareFrameData* frame_data) override { |
58 } | 58 } |
59 virtual void CopyToPixels(const gfx::Rect& rect, void* pixels) OVERRIDE { | 59 virtual void CopyToPixels(const gfx::Rect& rect, void* pixels) override { |
60 NOTIMPLEMENTED(); | 60 NOTIMPLEMENTED(); |
61 } | 61 } |
62 | 62 |
63 private: | 63 private: |
64 SynchronousCompositorOutputSurface* surface_; | 64 SynchronousCompositorOutputSurface* surface_; |
65 SkCanvas null_canvas_; | 65 SkCanvas null_canvas_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(SoftwareDevice); | 67 DISALLOW_COPY_AND_ASSIGN(SoftwareDevice); |
68 }; | 68 }; |
69 | 69 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 292 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
293 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 293 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
294 } | 294 } |
295 | 295 |
296 SynchronousCompositorOutputSurfaceDelegate* | 296 SynchronousCompositorOutputSurfaceDelegate* |
297 SynchronousCompositorOutputSurface::GetDelegate() { | 297 SynchronousCompositorOutputSurface::GetDelegate() { |
298 return SynchronousCompositorImpl::FromRoutingID(routing_id_); | 298 return SynchronousCompositorImpl::FromRoutingID(routing_id_); |
299 } | 299 } |
300 | 300 |
301 } // namespace content | 301 } // namespace content |
OLD | NEW |