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

Unified Diff: content/browser/compositor/software_output_device_mac.h

Issue 1420533005: Mac: Kill lots of AcceleratedWidget code (with fire) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/compositor/software_output_device_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/software_output_device_mac.h
diff --git a/content/browser/compositor/software_output_device_mac.h b/content/browser/compositor/software_output_device_mac.h
index 5b6ac86b77d56659d23cb4d062fcfe53a441b30a..8b48aeb22c336f7677efed38f2d27b841966d54f 100644
--- a/content/browser/compositor/software_output_device_mac.h
+++ b/content/browser/compositor/software_output_device_mac.h
@@ -5,7 +5,11 @@
#ifndef CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_MAC_H_
#define CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_MAC_H_
+#include <IOSurface/IOSurface.h>
+
+#include "base/mac/scoped_cftyperef.h"
#include "cc/output/software_output_device.h"
+#include "third_party/skia/include/core/SkRegion.h"
namespace gfx {
class Canvas;
@@ -22,10 +26,34 @@ class SoftwareOutputDeviceMac : public cc::SoftwareOutputDevice {
explicit SoftwareOutputDeviceMac(ui::Compositor* compositor);
~SoftwareOutputDeviceMac() override;
+ void Resize(const gfx::Size& pixel_size, float scale_factor) override;
+ SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
void EndPaint() override;
+ void DiscardBackbuffer() override;
+ void EnsureBackbuffer() override;
private:
+ bool EnsureBuffersExist();
+
+ // Copy the pixels from the previous buffer to the new buffer.
+ void CopyPreviousBufferDamage(const SkRegion& new_damage_rect);
+
ui::Compositor* compositor_;
+ gfx::Size pixel_size_;
+ float scale_factor_;
+
+ // This surface is double-buffered. The two buffers are in |io_surfaces_|,
+ // and the index of the current buffer is |current_buffer_|.
+ base::ScopedCFTypeRef<IOSurfaceRef> io_surfaces_[2];
+ int current_index_;
+
+ // The previous frame's damage rectangle. Used to copy unchanged content
+ // between buffers in CopyPreviousBufferDamage.
+ SkRegion previous_buffer_damage_region_;
+
+ // The SkCanvas wrapps the mapped current IOSurface. It is valid only between
+ // BeginPaint and EndPaint.
+ skia::RefPtr<SkCanvas> canvas_;
DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceMac);
};
« no previous file with comments | « no previous file | content/browser/compositor/software_output_device_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698