Lines Matching defs:emf
153 Emf::Emf() : emf_(NULL), hdc_(NULL) {
156 Emf::~Emf() {
160 void Emf::Close() {
167 bool Emf::InitToFile(const base::FilePath& metafile_path) {
174 bool Emf::InitFromFile(const base::FilePath& metafile_path) {
181 bool Emf::Init() {
188 bool Emf::InitFromData(const void* src_buffer, uint32 src_buffer_size) {
195 bool Emf::FinishDocument() {
203 bool Emf::Playback(HDC hdc, const RECT* rect) const {
207 // Get the natural bounds of the EMF buffer.
214 bool Emf::SafePlayback(HDC context) const {
221 Emf::EnumerationContext playback_context;
228 &Emf::SafePlaybackProc,
233 gfx::Rect Emf::GetPageBounds(unsigned int page_number) const {
249 uint32 Emf::GetDataSize() const {
254 bool Emf::GetData(void* buffer, uint32 size) const {
263 int CALLBACK Emf::SafePlaybackProc(HDC hdc,
268 Emf::EnumerationContext* context =
269 reinterpret_cast<Emf::EnumerationContext*>(param);
279 Emf::EnumerationContext::EnumerationContext() {
283 Emf::Record::Record(const ENHMETARECORD* record)
288 bool Emf::Record::Play(Emf::EnumerationContext* context) const {
295 bool Emf::Record::SafePlayback(Emf::EnumerationContext* context) const {
296 // For EMF field description, see [MS-EMF] Enhanced Metafile Format
299 // This is the second major EMF breakage I get; the first one being
303 // somehow choke on certain EMF records, but calling the corresponding
304 // function directly on the printer HDC is fine. Still, playing the EMF record
312 // So I resorted to manually parse the EMF records and play them one by one.
314 // an EMF buffer is that the later silently fixes the matrix to take in
324 // and the EMF buffer would always be played back at its native resolution.
452 SkBaseDevice* Emf::StartPageForVectorCanvas(
463 bool Emf::StartPage(const gfx::Size& /*page_size*/,
469 bool Emf::FinishPage() {
473 Emf::Enumerator::Enumerator(const Emf& emf, HDC context, const RECT* rect) {
476 emf.emf(),
477 &Emf::Enumerator::EnhMetaFileProc,
486 Emf::Enumerator::const_iterator Emf
490 Emf::Enumerator::const_iterator Emf::Enumerator::end() const {
494 int CALLBACK Emf::Enumerator::EnhMetaFileProc(HDC hdc,
499 Enumerator& emf = *reinterpret_cast<Enumerator*>(param);
500 if (!emf.context_.handle_table) {
501 DCHECK(!emf.context_.handle_table);
502 DCHECK(!emf.context_.objects_count);
503 emf.context_.handle_table = handle_table;
504 emf.context_.objects_count = objects_count;
505 emf.context_.hdc = hdc;
507 DCHECK_EQ(emf.context_.handle_table, handle_table);
508 DCHECK_EQ(emf.context_.objects_count, objects_count);
509 DCHECK_EQ(emf.context_.hdc, hdc);
511 emf.items_.push_back(Record(record));
515 bool Emf::IsAlphaBlendUsed() const {
518 emf(),
525 scoped_ptr<Emf> Emf::RasterizeMetafile(int raster_area_in_pixels) const {
544 scoped_ptr<Emf> result(new Emf);
570 scoped_ptr<Emf> Emf::RasterizeAlphaBlend() const {
583 scoped_ptr<Emf> result(new Emf);
591 ::EnumEnhMetaFile(hdc, emf(), &RasterizeAlphaBlendProc, &bitmap_dc, &rect);