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

Unified Diff: ui/gfx/ozone/impl/dri_skbitmap.cc

Issue 49303002: [Ozone] Rename software implementation files to use Dri prefix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ifdef Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/ozone/impl/dri_skbitmap.h ('k') | ui/gfx/ozone/impl/dri_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/ozone/impl/dri_skbitmap.cc
diff --git a/ui/gfx/ozone/impl/drm_skbitmap_ozone.cc b/ui/gfx/ozone/impl/dri_skbitmap.cc
similarity index 80%
rename from ui/gfx/ozone/impl/drm_skbitmap_ozone.cc
rename to ui/gfx/ozone/impl/dri_skbitmap.cc
index 0a21d92eaaf2d4558f6407d4c7adcb97e48a0b27..b965c7384ef745b3bae046b61fe4d7cda08a5c5b 100644
--- a/ui/gfx/ozone/impl/drm_skbitmap_ozone.cc
+++ b/ui/gfx/ozone/impl/dri_skbitmap.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/ozone/impl/drm_skbitmap_ozone.h"
+#include "ui/gfx/ozone/impl/dri_skbitmap.h"
#include <errno.h>
#include <sys/mman.h>
@@ -29,14 +29,14 @@ void DestroyDumbBuffer(int fd, uint32_t handle) {
// in the SkPixelRef.
// At the end of its life the SkPixelRef is responsible for deallocating the
// pixel memory.
-class DrmSkPixelRef : public SkPixelRef {
+class DriSkPixelRef : public SkPixelRef {
public:
- DrmSkPixelRef(void* pixels,
+ DriSkPixelRef(void* pixels,
SkColorTable* color_table_,
size_t size,
int fd,
uint32_t handle);
- virtual ~DrmSkPixelRef();
+ virtual ~DriSkPixelRef();
virtual void* onLockPixels(SkColorTable** ct) OVERRIDE;
virtual void onUnlockPixels() OVERRIDE;
@@ -59,13 +59,13 @@ class DrmSkPixelRef : public SkPixelRef {
// Handle for the allocated memory.
uint32_t handle_;
- DISALLOW_COPY_AND_ASSIGN(DrmSkPixelRef);
+ DISALLOW_COPY_AND_ASSIGN(DriSkPixelRef);
};
////////////////////////////////////////////////////////////////////////////////
-// DrmSkPixelRef implementation
+// DriSkPixelRef implementation
-DrmSkPixelRef::DrmSkPixelRef(
+DriSkPixelRef::DriSkPixelRef(
void* pixels,
SkColorTable* color_table,
size_t size,
@@ -78,47 +78,47 @@ DrmSkPixelRef::DrmSkPixelRef(
handle_(handle) {
}
-DrmSkPixelRef::~DrmSkPixelRef() {
+DriSkPixelRef::~DriSkPixelRef() {
munmap(pixels_, size_);
DestroyDumbBuffer(fd_, handle_);
}
-void* DrmSkPixelRef::onLockPixels(SkColorTable** ct) {
+void* DriSkPixelRef::onLockPixels(SkColorTable** ct) {
*ct = color_table_;
return pixels_;
}
-void DrmSkPixelRef::onUnlockPixels() {
+void DriSkPixelRef::onUnlockPixels() {
}
} // namespace
// Allocates pixel memory for a SkBitmap using DRM dumb buffers.
-class DrmAllocator : public SkBitmap::Allocator {
+class DriAllocator : public SkBitmap::Allocator {
public:
- DrmAllocator();
+ DriAllocator();
virtual bool allocPixelRef(SkBitmap* bitmap,
SkColorTable* color_table) OVERRIDE;
private:
- bool AllocatePixels(DrmSkBitmapOzone* bitmap, SkColorTable* color_table);
+ bool AllocatePixels(DriSkBitmap* bitmap, SkColorTable* color_table);
- DISALLOW_COPY_AND_ASSIGN(DrmAllocator);
+ DISALLOW_COPY_AND_ASSIGN(DriAllocator);
};
////////////////////////////////////////////////////////////////////////////////
-// DrmAllocator implementation
+// DriAllocator implementation
-DrmAllocator::DrmAllocator() {
+DriAllocator::DriAllocator() {
}
-bool DrmAllocator::allocPixelRef(SkBitmap* bitmap,
+bool DriAllocator::allocPixelRef(SkBitmap* bitmap,
SkColorTable* color_table) {
- return AllocatePixels(static_cast<DrmSkBitmapOzone*>(bitmap), color_table);
+ return AllocatePixels(static_cast<DriSkBitmap*>(bitmap), color_table);
}
-bool DrmAllocator::AllocatePixels(DrmSkBitmapOzone* bitmap,
+bool DriAllocator::AllocatePixels(DriSkBitmap* bitmap,
SkColorTable* color_table) {
struct drm_mode_create_dumb request;
request.width = bitmap->width();
@@ -158,7 +158,7 @@ bool DrmAllocator::AllocatePixels(DrmSkBitmapOzone* bitmap,
return false;
}
- bitmap->setPixelRef(new DrmSkPixelRef(
+ bitmap->setPixelRef(new DriSkPixelRef(
pixels,
color_table,
bitmap->getSize(),
@@ -170,23 +170,23 @@ bool DrmAllocator::AllocatePixels(DrmSkBitmapOzone* bitmap,
}
////////////////////////////////////////////////////////////////////////////////
-// DrmSkBitmapOzone implementation
+// DriSkBitmap implementation
-DrmSkBitmapOzone::DrmSkBitmapOzone(int fd)
+DriSkBitmap::DriSkBitmap(int fd)
: fd_(fd),
handle_(0),
framebuffer_(0) {
}
-DrmSkBitmapOzone::~DrmSkBitmapOzone() {
+DriSkBitmap::~DriSkBitmap() {
}
-bool DrmSkBitmapOzone::Initialize() {
- DrmAllocator drm_allocator;
+bool DriSkBitmap::Initialize() {
+ DriAllocator drm_allocator;
return allocPixels(&drm_allocator, NULL);
}
-uint8_t DrmSkBitmapOzone::GetColorDepth() const {
+uint8_t DriSkBitmap::GetColorDepth() const {
switch (config()) {
case SkBitmap::kNo_Config:
case SkBitmap::kA1_Config:
« no previous file with comments | « ui/gfx/ozone/impl/dri_skbitmap.h ('k') | ui/gfx/ozone/impl/dri_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698