Lines Matching defs:Emf
168 Emf::Emf() : emf_(NULL), hdc_(NULL), page_count_(0) {
171 Emf::~Emf() {
177 bool Emf::InitToFile(const base::FilePath& metafile_path) {
184 bool Emf::InitFromFile(const base::FilePath& metafile_path) {
191 bool Emf::Init() {
198 bool Emf::InitFromData(const void* src_buffer, uint32 src_buffer_size) {
205 bool Emf::FinishDocument() {
213 bool Emf::Playback(HDC hdc, const RECT* rect) const {
217 // Get the natural bounds of the EMF buffer.
224 bool Emf::SafePlayback(HDC context) const {
231 Emf::EnumerationContext playback_context;
236 &Emf::SafePlaybackProc,
241 gfx::Rect Emf::GetPageBounds(unsigned int page_number) const {
257 uint32 Emf::GetDataSize() const {
262 bool Emf::GetData(void* buffer, uint32 size) const {
271 bool Emf::GetDataAsVector(std::vector<uint8>* buffer) const {
282 bool Emf::SaveTo(const base::FilePath& file_path) const {
303 int CALLBACK Emf::SafePlaybackProc(HDC hdc,
308 Emf::EnumerationContext* context =
309 reinterpret_cast<Emf::EnumerationContext*>(param);
319 Emf::EnumerationContext::EnumerationContext() {
323 Emf::Record::Record(const ENHMETARECORD* record)
328 bool Emf::Record::Play(Emf::EnumerationContext* context) const {
335 bool Emf::Record::SafePlayback(Emf::EnumerationContext* context) const {
336 // For EMF field description, see [MS-EMF] Enhanced Metafile Format
339 // This is the second major EMF breakage I get; the first one being
343 // somehow choke on certain EMF records, but calling the corresponding
344 // function directly on the printer HDC is fine. Still, playing the EMF record
352 // So I resorted to manually parse the EMF records and play them one by one.
354 // an EMF buffer is that the later silently fixes the matrix to take in
364 // and the EMF buffer would always be played back at its native resolution.
520 SkDevice* Emf::StartPageForVectorCanvas(
531 bool Emf::StartPage(const gfx::Size& /*page_size*/,
543 bool Emf::FinishPage() {
552 Emf::Enumerator::Enumerator(const Emf& emf, HDC context, const RECT* rect) {
555 emf.emf(),
556 &Emf::Enumerator::EnhMetaFileProc,
565 Emf::Enumerator::const_iterator Emf::Enumerator::begin() const {
569 Emf::Enumerator::const_iterator Emf::Enumerator::end() const {
573 int CALLBACK Emf::Enumerator::EnhMetaFileProc(HDC hdc,
578 Enumerator& emf = *reinterpret_cast<Enumerator*>(param);
579 if (!emf.context_.handle_table) {
580 DCHECK(!emf.context_.handle_table);
581 DCHECK(!emf.context_.objects_count);
582 emf.context_.handle_table = handle_table;
583 emf.context_.objects_count = objects_count;
584 emf.context_.hdc = hdc;
586 DCHECK_EQ(emf.context_.handle_table, handle_table);
587 DCHECK_EQ(emf.context_.objects_count, objects_count);
588 DCHECK_EQ(emf.context_.hdc, hdc);
590 emf.items_.push_back(Record(record));
594 bool Emf::IsAlphaBlendUsed() const {
597 emf(),
604 Emf* Emf::RasterizeMetafile(int raster_area_in_pixels) const {
623 scoped_ptr<Emf> result(new Emf);
649 Emf* Emf::RasterizeAlphaBlend() const {
662 scoped_ptr<Emf> result(new Emf);
670 ::EnumEnhMetaFile(hdc, emf(), &RasterizeAlphaBlendProc, &bitmap_dc, &rect);