cef/libcef/browser/osr/software_output_device_osr.h
Marshall Greenblatt e7ddc933c9 Update to Chromium revision 6e53600d (#386251)
- Remove |accept_lang| parameter from CefJSDialogHandler::OnJSDialog
  and CefFormatUrlForSecurityDisplay (see https://crbug.com/336973#c36).
- Remove remaining NPAPI-related code including functions from
  cef_web_plugin.h (see https://crbug.com/493212#c55).
- Mac: 10.7+ deployment target is now required for client applications.
- Mac: Remove CefBrowserHost::SetWindowVisibility (issue #1375). No
  replacement is required for windowed rendering. Use WasHidden for
  off-screen rendering.
- Windows: Visual Studio 2015 Update 2 is now required when building
  CEF/Chromium.
2016-04-28 12:57:08 -04:00

55 lines
1.7 KiB
C++

// Copyright (c) 2014 The Chromium Embedded Framework Authors.
// Portions copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_OSR_SOFTWARE_OUTPUT_DEVICE_OSR_H_
#define CEF_LIBCEF_BROWSER_OSR_SOFTWARE_OUTPUT_DEVICE_OSR_H_
#include "base/callback.h"
#include "cc/output/software_output_device.h"
namespace ui {
class Compositor;
}
// Device implementation for direct software rendering via DelegatedFrameHost.
// All Rect/Size values are in pixels.
class CefSoftwareOutputDeviceOSR : public cc::SoftwareOutputDevice {
public:
typedef base::Callback<void(const gfx::Rect&,int,int,void*)>
OnPaintCallback;
CefSoftwareOutputDeviceOSR(ui::Compositor* compositor,
bool transparent,
const OnPaintCallback& callback);
~CefSoftwareOutputDeviceOSR() override;
// cc::SoftwareOutputDevice implementation.
void Resize(const gfx::Size& viewport_pixel_size,
float scale_factor) override;
SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
void EndPaint() override;
void SetActive(bool active);
// Include |damage_rect| the next time OnPaint is called.
void Invalidate(const gfx::Rect& damage_rect);
// Deliver the OnPaint notification immediately.
void OnPaint(const gfx::Rect& damage_rect);
private:
const bool transparent_;
const OnPaintCallback callback_;
bool active_;
std::unique_ptr<SkCanvas> canvas_;
std::unique_ptr<SkBitmap> bitmap_;
gfx::Rect pending_damage_rect_;
DISALLOW_COPY_AND_ASSIGN(CefSoftwareOutputDeviceOSR);
};
#endif // CEF_LIBCEF_BROWSER_OSR_SOFTWARE_OUTPUT_DEVICE_OSR_H_