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

Side by Side Diff: sky/engine/core/fetch/ImageResource.cpp

Issue 715963003: Remove alt text from images. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: minor improvement Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « sky/engine/core/fetch/ImageResource.h ('k') | sky/engine/core/frame/LocalFrame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 { 159 {
160 if (deviceScaleFactor >= 2) { 160 if (deviceScaleFactor >= 2) {
161 DEFINE_STATIC_REF(blink::Image, brokenImageHiRes, (blink::Image::loadPla tformResource("missingImage@2x"))); 161 DEFINE_STATIC_REF(blink::Image, brokenImageHiRes, (blink::Image::loadPla tformResource("missingImage@2x")));
162 return std::make_pair(brokenImageHiRes, 2); 162 return std::make_pair(brokenImageHiRes, 2);
163 } 163 }
164 164
165 DEFINE_STATIC_REF(blink::Image, brokenImageLoRes, (blink::Image::loadPlatfor mResource("missingImage"))); 165 DEFINE_STATIC_REF(blink::Image, brokenImageLoRes, (blink::Image::loadPlatfor mResource("missingImage")));
166 return std::make_pair(brokenImageLoRes, 1); 166 return std::make_pair(brokenImageLoRes, 1);
167 } 167 }
168 168
169 bool ImageResource::willPaintBrokenImage() const
170 {
171 return errorOccurred();
172 }
173
174 blink::Image* ImageResource::image() 169 blink::Image* ImageResource::image()
175 { 170 {
176 ASSERT(!isPurgeable()); 171 ASSERT(!isPurgeable());
177 172
178 if (errorOccurred()) { 173 if (errorOccurred()) {
179 // Returning the 1x broken image is non-ideal, but we cannot reliably ac cess the appropriate 174 // Returning the 1x broken image is non-ideal, but we cannot reliably ac cess the appropriate
180 // deviceScaleFactor from here. It is critical that callers use ImageRes ource::brokenImage() 175 // deviceScaleFactor from here. It is critical that callers use ImageRes ource::brokenImage()
181 // when they need the real, deviceScaleFactor-appropriate broken image i con. 176 // when they need the real, deviceScaleFactor-appropriate broken image i con.
182 return brokenImage(1).first; 177 return brokenImage(1).first;
183 } 178 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 422
428 bool ImageResource::currentFrameKnownToBeOpaque(const RenderObject* renderer) 423 bool ImageResource::currentFrameKnownToBeOpaque(const RenderObject* renderer)
429 { 424 {
430 blink::Image* image = imageForRenderer(renderer); 425 blink::Image* image = imageForRenderer(renderer);
431 if (image->isBitmapImage()) 426 if (image->isBitmapImage())
432 image->nativeImageForCurrentFrame(); // force decode 427 image->nativeImageForCurrentFrame(); // force decode
433 return image->currentFrameKnownToBeOpaque(); 428 return image->currentFrameKnownToBeOpaque();
434 } 429 }
435 430
436 } // namespace blink 431 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/fetch/ImageResource.h ('k') | sky/engine/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698